All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Keith Busch <kbusch@kernel.org>, Neptune <z1281552865@gmail.com>,
	0wnerD1ed <l7z@0b1t.tech>,
	linux-block@vger.kernel.org
Subject: [PATCH 1/2] block: handle huge zero folios in bio_free_folios
Date: Thu, 16 Jul 2026 11:12:45 +0200	[thread overview]
Message-ID: <20260716091306.316625-2-hch@lst.de> (raw)
In-Reply-To: <20260716091306.316625-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


  reply	other threads:[~2026-07-16  9:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16  9:12 bio bounce buffering fixes v3 Christoph Hellwig
2026-07-16  9:12 ` Christoph Hellwig [this message]
2026-07-16  9:12 ` [PATCH 2/2] block: fix aligning of bounced dio read bios Christoph Hellwig
2026-07-29 12:26   ` Shin'ichiro Kawasaki
2026-07-16 12:12 ` bio bounce buffering fixes v3 Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2026-07-15  6:42 bio bounce buffering fixes v2 Christoph Hellwig
2026-07-15  6:42 ` [PATCH 1/2] block: handle huge zero folios in bio_free_folios Christoph Hellwig
2026-07-15  7:04   ` Hannes Reinecke

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=20260716091306.316625-2-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=kbusch@kernel.org \
    --cc=l7z@0b1t.tech \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.