From: John Garry <john.g.garry@oracle.com>
To: Yu Kuai <yukuai1@huaweicloud.com>,
hch@infradead.org, axboe@kernel.dk, xni@redhat.com,
agk@redhat.com, snitzer@kernel.org, mpatocka@redhat.com,
song@kernel.org, yukuai3@huawei.com, cl@linux.com,
nadav.amit@gmail.com, ubizjak@gmail.com,
akpm@linux-foundation.org
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
dm-devel@lists.linux.dev, linux-raid@vger.kernel.org,
yi.zhang@huawei.com, yangerkun@huawei.com,
johnny.chenyi@huawei.com
Subject: Re: [PATCH v2 3/9] block: WARN if bdev inflight counter is negative
Date: Mon, 28 Apr 2025 15:06:51 +0100 [thread overview]
Message-ID: <4c6ac59f-0589-4cb9-b909-354d02ee1a44@oracle.com> (raw)
In-Reply-To: <20250427082928.131295-4-yukuai1@huaweicloud.com>
On 27/04/2025 09:29, Yu Kuai wrote:
> From: Yu Kuai <yukuai3@huawei.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@huawei.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;
> }
>
next prev parent reply other threads:[~2025-04-28 14:07 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-27 8:29 [PATCH v2 0/9] md: fix is_mddev_idle() Yu Kuai
2025-04-27 8:29 ` [PATCH v2 1/9] blk-mq: remove blk_mq_in_flight() Yu Kuai
2025-04-28 13:06 ` Christoph Hellwig
2025-04-28 13:45 ` John Garry
2025-04-29 1:40 ` Yu Kuai
2025-04-29 6:25 ` Hannes Reinecke
2025-04-27 8:29 ` [PATCH v2 2/9] block: reuse part_in_flight_rw for part_in_flight Yu Kuai
2025-04-28 13:06 ` Christoph Hellwig
2025-04-28 13:47 ` John Garry
2025-04-29 6:25 ` Hannes Reinecke
2025-04-27 8:29 ` [PATCH v2 3/9] block: WARN if bdev inflight counter is negative Yu Kuai
2025-04-28 13:07 ` Christoph Hellwig
2025-04-28 14:06 ` John Garry [this message]
2025-04-29 1:43 ` Yu Kuai
2025-04-29 8:53 ` John Garry
2025-04-29 6:27 ` Hannes Reinecke
2025-04-27 8:29 ` [PATCH v2 4/9] block: cleanup blk_mq_in_flight_rw() Yu Kuai
2025-04-28 13:08 ` Christoph Hellwig
2025-04-29 6:31 ` Hannes Reinecke
2025-04-29 9:07 ` Yu Kuai
2025-04-27 8:29 ` [PATCH v2 5/9] block: export API to get the number of bdev inflight IO Yu Kuai
2025-04-28 13:08 ` Christoph Hellwig
2025-04-29 6:32 ` Hannes Reinecke
2025-04-27 8:29 ` [PATCH v2 6/9] md: record dm-raid gendisk in mddev Yu Kuai
2025-04-27 8:29 ` [PATCH v2 7/9] md: add a new api sync_io_depth Yu Kuai
2025-04-27 8:29 ` [PATCH v2 8/9] md: fix is_mddev_idle() Yu Kuai
2025-04-27 9:51 ` Paul Menzel
2025-04-29 5:45 ` Xiao Ni
2025-04-29 9:12 ` Yu Kuai
2025-04-27 8:29 ` [PATCH v2 9/9] md: cleanup accounting for issued sync IO Yu Kuai
2025-04-27 9:59 ` [PATCH v2 0/9] md: fix is_mddev_idle() Paul Menzel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4c6ac59f-0589-4cb9-b909-354d02ee1a44@oracle.com \
--to=john.g.garry@oracle.com \
--cc=agk@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=cl@linux.com \
--cc=dm-devel@lists.linux.dev \
--cc=hch@infradead.org \
--cc=johnny.chenyi@huawei.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=nadav.amit@gmail.com \
--cc=snitzer@kernel.org \
--cc=song@kernel.org \
--cc=ubizjak@gmail.com \
--cc=xni@redhat.com \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yukuai1@huaweicloud.com \
--cc=yukuai3@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox