mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-01 23:04:54 +01: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/[email protected] Signed-off-by: Yu Kuai <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: John Garry <[email protected]>
This commit is contained in:
1 parent
5b8f19aee4
commit
f5482ee5ed
1 file changed
+2
-2
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user