public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Nitesh Shetty <nj.shetty@samsung.com>
To: Ming Lei <ming.lei@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, io-uring@vger.kernel.org,
	Caleb Sander Mateos <csander@purestorage.com>,
	huang-jl <huang-jl@deepseek.com>
Subject: Re: [PATCH 1/3] block: fix bio_may_need_split() by using bvec iterator way
Date: Sat, 20 Dec 2025 13:49:22 +0530	[thread overview]
Message-ID: <20251220081922.3bbmpvjorqcad5rb@green245.gost> (raw)
In-Reply-To: <20251218093146.1218279-2-ming.lei@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1146 bytes --]

On 18/12/25 05:31PM, Ming Lei wrote:
>->bi_vcnt doesn't make sense for cloned bio, which is perfectly fine
>passed to bio_may_need_split().
>
>So fix bio_may_need_split() by not taking ->bi_vcnt directly, instead
>checking with help from bio size and bvec->len.
>
>Meantime retrieving the 1st bvec via __bvec_iter_bvec().
>
>Fixes: abd45c159df5 ("block: handle fast path of bio splitting inline")
>Signed-off-by: Ming Lei <ming.lei@redhat.com>
>---
> block/blk.h | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
>diff --git a/block/blk.h b/block/blk.h
>index e4c433f62dfc..a0b9cecba8fa 100644
>--- a/block/blk.h
>+++ b/block/blk.h
>@@ -371,12 +371,19 @@ struct bio *bio_split_zone_append(struct bio *bio,
> static inline bool bio_may_need_split(struct bio *bio,
> 		const struct queue_limits *lim)
> {
>+	const struct bio_vec *bv;
>+
> 	if (lim->chunk_sectors)
> 		return true;
>-	if (bio->bi_vcnt != 1)
>+
>+	if ((bio_op(bio) != REQ_OP_READ && bio_op(bio) != REQ_OP_WRITE) ||
>+			!bio->bi_io_vec)
REQ_OP_READ, REQ_OP_WRITE check is not necessary, since bio_may_need_split
is always called for READ/WRITE.

Thanks,
Nitesh

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  parent reply	other threads:[~2025-12-20  8:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-18  9:31 [PATCH 0/3] block: fix bi_vcnt misuse for cloned bio Ming Lei
2025-12-18  9:31 ` [PATCH 1/3] block: fix bio_may_need_split() by using bvec iterator way Ming Lei
2025-12-18  9:37   ` Christoph Hellwig
2025-12-18  9:45     ` Ming Lei
2025-12-18 15:16       ` Nitesh Shetty
2025-12-18 16:08         ` Ming Lei
2025-12-20  8:16           ` Nitesh Shetty
2025-12-20  8:19   ` Nitesh Shetty [this message]
2025-12-18  9:31 ` [PATCH 2/3] block: don't initialize bi_vcnt for cloned bio in bio_iov_bvec_set() Ming Lei
2025-12-18  9:38   ` Christoph Hellwig
2025-12-18  9:48     ` Ming Lei
2025-12-18  9:31 ` [PATCH 3/3] io_uring: don't re-calculate iov_iter nr_segs in io_import_kbuf() Ming Lei

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=20251220081922.3bbmpvjorqcad5rb@green245.gost \
    --to=nj.shetty@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=csander@purestorage.com \
    --cc=huang-jl@deepseek.com \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.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