[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4c6ac59f-0589-4cb9-b909-354d02ee1a44@oracle.com>
Date: Mon, 28 Apr 2025 15:06:51 +0100
From: John Garry <john.g.garry@...cle.com>
To: Yu Kuai <yukuai1@...weicloud.com>, hch@...radead.org, axboe@...nel.dk,
xni@...hat.com, agk@...hat.com, snitzer@...nel.org,
mpatocka@...hat.com, song@...nel.org, yukuai3@...wei.com, cl@...ux.com,
nadav.amit@...il.com, ubizjak@...il.com, akpm@...ux-foundation.org
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
dm-devel@...ts.linux.dev, linux-raid@...r.kernel.org,
yi.zhang@...wei.com, yangerkun@...wei.com, johnny.chenyi@...wei.com
Subject: Re: [PATCH v2 3/9] block: WARN if bdev inflight counter is negative
On 27/04/2025 09:29, Yu Kuai wrote:
> From: Yu Kuai <yukuai3@...wei.com>
>
> Which means there is a BUG
nit: to me, BUG means symbol BUG(), and not a software bug (which I
think that you mean)
> for related bio-based disk driver, or blk-mq
> for rq-based disk, it's better not to hide the BUG.
AFICS, this check was not present for mq, so is it really required now?
I suppose that the code is simpler to always have the check. I find it
an odd check to begin with...
>
> Signed-off-by: Yu Kuai <yukuai3@...wei.com>
> ---
> block/genhd.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/block/genhd.c b/block/genhd.c
> index f671d9ee00c4..d158c25237b6 100644
> --- a/block/genhd.c
> +++ b/block/genhd.c
> @@ -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;
> }
>
Powered by blists - more mailing lists