From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Christoph Hellwig <hch@lst.de>,
Hans Holmberg <hans.holmberg@wdc.com>,
Carlos Maiolino <cmaiolino@redhat.com>,
Damien Le Moal <dlemoal@kernel.org>,
Carlos Maiolino <cem@kernel.org>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.18.y 1/8] xfs: use bio_reuse in the zone GC code
Date: Sat, 18 Jul 2026 11:47:52 -0400 [thread overview]
Message-ID: <20260718154759.3315619-1-sashal@kernel.org> (raw)
In-Reply-To: <2026071416-estranged-decree-ecfc@gregkh>
From: Christoph Hellwig <hch@lst.de>
[ Upstream commit 0506d32f7c52e41f6e8db7c337e0ce6374c6ffbb ]
Replace our somewhat fragile code to reuse the bio, which caused a
regression in the past with the block layer bio_reuse helper.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hans Holmberg <hans.holmberg@wdc.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
[ sashal: open-coded the bio_reuse logic at the call site as 6.18 lacks
commit 7ca44303f9f6 ("block: add a bio_reuse helper") ]
Stable-dep-of: ae3692c7f440 ("xfs: add newly added RTGs to the free pool in growfs")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/xfs/xfs_zone_gc.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/fs/xfs/xfs_zone_gc.c b/fs/xfs/xfs_zone_gc.c
index d18c43598d4b39..9ea9166c76d277 100644
--- a/fs/xfs/xfs_zone_gc.c
+++ b/fs/xfs/xfs_zone_gc.c
@@ -813,9 +813,8 @@ xfs_zone_gc_write_chunk(
{
struct xfs_zone_gc_data *data = chunk->data;
struct xfs_mount *mp = chunk->ip->i_mount;
- phys_addr_t bvec_paddr =
- bvec_phys(bio_first_bvec_all(&chunk->bio));
struct xfs_gc_bio *split_chunk;
+ unsigned short vcnt, i;
if (chunk->bio.bi_status)
xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR);
@@ -827,10 +826,11 @@ xfs_zone_gc_write_chunk(
WRITE_ONCE(chunk->state, XFS_GC_BIO_NEW);
list_move_tail(&chunk->entry, &data->writing);
+ vcnt = chunk->bio.bi_vcnt;
bio_reset(&chunk->bio, mp->m_rtdev_targp->bt_bdev, REQ_OP_WRITE);
- bio_add_folio_nofail(&chunk->bio, chunk->scratch->folio, chunk->len,
- offset_in_folio(chunk->scratch->folio, bvec_paddr));
-
+ for (i = 0; i < vcnt; i++)
+ chunk->bio.bi_iter.bi_size += chunk->bio.bi_io_vec[i].bv_len;
+ chunk->bio.bi_vcnt = vcnt;
while ((split_chunk = xfs_zone_gc_split_write(data, chunk)))
xfs_zone_gc_submit_write(data, split_chunk);
xfs_zone_gc_submit_write(data, chunk);
--
2.53.0
prev parent reply other threads:[~2026-07-18 15:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 15:55 FAILED: patch "[PATCH] xfs: add newly added RTGs to the free pool in growfs" failed to apply to 6.18-stable tree gregkh
2026-07-18 15:47 ` Sasha Levin [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=20260718154759.3315619-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=cem@kernel.org \
--cc=cmaiolino@redhat.com \
--cc=dlemoal@kernel.org \
--cc=hans.holmberg@wdc.com \
--cc=hch@lst.de \
--cc=stable@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 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.