]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xfs: fix number of GC bvecs
authorChristoph Hellwig <hch@lst.de>
Mon, 6 Apr 2026 05:54:17 +0000 (07:54 +0200)
committerCarlos Maiolino <cem@kernel.org>
Tue, 7 Apr 2026 11:33:11 +0000 (13:33 +0200)
commit2ffc6900d5c3a7cd59becda2aa67581d9bd3858e
tree713cbcebe526a223c1e133657d68a14831f45e38
parent9de45faed34d11f1821c386ea306d9788e9a6448
xfs: fix number of GC bvecs

GC scratch allocations can wrap around and use the same buffer twice, and
the current code fails to account for that.  So far this worked due to
rounding in the block layer, but changes to the bio allocator drop the
over-provisioning and generic/256 or generic/361 will now usually fail
when running against the current block tree.

Simplify the allocation to always pass the maximum value that is easier to
verify, as a saving of up to one bvec per allocation isn't worth the
effort to verify a complicated calculated value.

Fixes: 102f444b57b3 ("xfs: rework zone GC buffer management")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_zone_gc.c