Linux block layer
 help / color / mirror / Atom feed
From: Anuj Gupta <anuj1072538@gmail.com>
To: axboe@kernel.dk, asml.silence@gmail.com, hch@lst.de
Cc: kbusch@kernel.org, linux-block@vger.kernel.org, anuj20.g@samsung.com
Subject: [PATCH] block: don't use the bvec fast path for dma-buf bios
Date: Thu, 29 Oct 2026 16:23:30 +0530	[thread overview]
Message-ID: <20261029105330.1427462-1-anuj1072538@gmail.com> (raw)

From: Anuj Gupta <anuj20.g@samsung.com>

bio_may_need_split() reads bi_io_vec, which for dma-buf bios aliases
bi_dmabuf_map, and interprets the map as a bvec. Always run the full
split check for dma-buf bios.

Fixes: d88e44f43e93 ("block: introduce dma map backed bio type")
Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
---
 block/blk.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/block/blk.h b/block/blk.h
index 50abfd932886..27b568cedc43 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -404,6 +404,8 @@ static inline bool bio_may_need_split(struct bio *bio,
 
 	if (!bio->bi_io_vec)
 		return true;
+	if (op_is_dmabuf(bio->bi_opf))
+		return true;
 
 	bv = __bvec_iter_bvec(bio->bi_io_vec, bio->bi_iter);
 	if (bio->bi_iter.bi_size > bv->bv_len - bio->bi_iter.bi_offset)
-- 
2.43.0


             reply	other threads:[~2026-10-29 10:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29 10:53 Anuj Gupta [this message]
2026-10-29 11:49 ` [PATCH] block: don't use the bvec fast path for dma-buf bios Pavel Begunkov
2026-10-29 12:34   ` Anuj gupta
2026-10-30  8:57 ` Pavel Begunkov
2026-11-03 14:31 ` Jens Axboe

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=20261029105330.1427462-1-anuj1072538@gmail.com \
    --to=anuj1072538@gmail.com \
    --cc=anuj20.g@samsung.com \
    --cc=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    /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