From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Keith Busch <kbusch@kernel.org>, Neptune <z1281552865@gmail.com>,
linux-block@vger.kernel.org
Subject: [PATCH 1/2] block: handle huge zero folios in bio_free_folios
Date: Wed, 15 Jul 2026 08:42:07 +0200 [thread overview]
Message-ID: <20260715064215.2934345-2-hch@lst.de> (raw)
In-Reply-To: <20260715064215.2934345-1-hch@lst.de>
When CONFIG_PERSISTENT_HUGE_ZERO_FOLIO is enabled, iomap_dio_zero() can
add a huge zero folio to a zeroing bio, which needs special treatment
in bio_free_folios by also checking is_huge_zero_folio() in addition to
is_zero_folio().
Fixes: 8dd5e7c75d7b ("block: add helpers to bounce buffer an iov_iter into bios")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/bio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/bio.c b/block/bio.c
index f2a5f4d0a967..4d6e5f5f5710 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1302,7 +1302,7 @@ static void bio_free_folios(struct bio *bio)
bio_for_each_bvec_all(bv, bio, i) {
struct folio *folio = bvec_folio(bv);
- if (!is_zero_folio(folio))
+ if (!is_zero_folio(folio) && !is_huge_zero_folio(folio))
folio_put(folio);
}
}
--
2.53.0
next prev parent reply other threads:[~2026-07-15 6:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 6:42 bio bounce buffering fixes v2 Christoph Hellwig
2026-07-15 6:42 ` Christoph Hellwig [this message]
2026-07-15 7:04 ` [PATCH 1/2] block: handle huge zero folios in bio_free_folios Hannes Reinecke
2026-07-15 6:42 ` [PATCH 2/2] block: fix aligning of bounced dio read bios Christoph Hellwig
2026-07-15 7:07 ` Hannes Reinecke
-- strict thread matches above, loose matches on Subject: below --
2026-07-16 9:12 bio bounce buffering fixes v3 Christoph Hellwig
2026-07-16 9:12 ` [PATCH 1/2] block: handle huge zero folios in bio_free_folios Christoph Hellwig
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=20260715064215.2934345-2-hch@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=z1281552865@gmail.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