From: Jens Axboe <axboe@kernel.dk>
To: linux-block@vger.kernel.org, Ming Lei <ming.lei@redhat.com>
Cc: Venkat Rao Bagalkote <venkat88@linux.ibm.com>,
Christoph Hellwig <hch@infradead.org>,
Nitesh Shetty <nj.shetty@samsung.com>
Subject: Re: [PATCH] block: account for bi_bvec_done in bio_may_need_split()
Date: Sat, 10 Jan 2026 09:56:07 -0700 [thread overview]
Message-ID: <176806416769.162964.16972858799904355920.b4-ty@kernel.dk> (raw)
In-Reply-To: <20260110134236.442681-1-ming.lei@redhat.com>
On Sat, 10 Jan 2026 21:42:36 +0800, Ming Lei wrote:
> When checking if a bio fits in a single segment, bio_may_need_split()
> compares bi_size against the current bvec's bv_len. However, for
> partially consumed bvecs (bi_bvec_done > 0), such as in cloned or
> split bios, the remaining bytes in the current bvec is actually
> (bv_len - bi_bvec_done), not bv_len.
>
> This could cause bio_may_need_split() to incorrectly return false,
> leading to nr_phys_segments being set to 1 when the bio actually
> spans multiple segments. This triggers the WARN_ON in __blk_rq_map_sg()
> when the actual mapped segments exceed the expected count.
>
> [...]
Applied, thanks!
[1/1] block: account for bi_bvec_done in bio_may_need_split()
commit: 5461a44ce37a507d8ed7e03cc65eefc52cb5a8f5
Best regards,
--
Jens Axboe
prev parent reply other threads:[~2026-01-10 16:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-10 13:42 [PATCH] block: account for bi_bvec_done in bio_may_need_split() Ming Lei
2026-01-10 16:56 ` Jens Axboe [this message]
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=176806416769.162964.16972858799904355920.b4-ty@kernel.dk \
--to=axboe@kernel.dk \
--cc=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=nj.shetty@samsung.com \
--cc=venkat88@linux.ibm.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