mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-08-27 06:18:54 +00:00
block: WARN if bdev inflight counter is negative
Which means there is a bug for related bio-based disk driver, or blk-mq for rq-based disk, it's better not to hide the bug. Link: https://lore.kernel.org/linux-raid/20250506124903.2540268-3-yukuai1@huaweicloud.com Signed-off-by: Yu Kuai <yukuai3@huawei.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: John Garry <john.g.garry@oracle.com>
This commit is contained in:
parent
5b8f19aee4
commit
f5482ee5ed
@ -136,9 +136,9 @@ static void part_in_flight_rw(struct block_device *part,
|
||||
inflight[0] += part_stat_local_read_cpu(part, in_flight[0], cpu);
|
||||
inflight[1] += part_stat_local_read_cpu(part, in_flight[1], cpu);
|
||||
}
|
||||
if ((int)inflight[0] < 0)
|
||||
if (WARN_ON_ONCE((int)inflight[0] < 0))
|
||||
inflight[0] = 0;
|
||||
if ((int)inflight[1] < 0)
|
||||
if (WARN_ON_ONCE((int)inflight[1] < 0))
|
||||
inflight[1] = 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user