]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xfs: use a seprate member to track space availabe in the GC scatch buffer
authorChristoph Hellwig <hch@lst.de>
Tue, 27 Jan 2026 15:10:20 +0000 (16:10 +0100)
committerCarlos Maiolino <cem@kernel.org>
Thu, 29 Jan 2026 09:57:18 +0000 (10:57 +0100)
commitc17a1c03493bee4e7882ac79a52b8150cb464e56
tree033266e671f9fdf24daa6b04fa104a8a170ddd00
parent692243cac63195ba38512a86bdb47b9c3190716b
xfs: use a seprate member to track space availabe in the GC scatch buffer

When scratch_head wraps back to 0 and scratch_tail is also 0 because no
I/O has completed yet, the ring buffer could be mistaken for empty.

Fix this by introducing a separate scratch_available member in
struct xfs_zone_gc_data.  This actually ends up simplifying the code as
well.

Reported-by: Chris Mason <clm@meta.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_zone_gc.c