]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xfs: fix zoned GC data corruption due to wrong bv_offset
authorChristoph Hellwig <hch@lst.de>
Mon, 12 May 2025 14:43:05 +0000 (16:43 +0200)
committerCarlos Maiolino <cem@kernel.org>
Wed, 14 May 2025 13:37:49 +0000 (15:37 +0200)
commitfbecd731de05707a73a3d86c6cbe6b9441cdbedc
tree24fca9158d0c29ebbce1560bcc97f5b1702fc399
parent09dab6ce0243bc1939bd1f77a066ccdd72d44efe
xfs: fix zoned GC data corruption due to wrong bv_offset

xfs_zone_gc_write_chunk writes out the data buffer read in earlier using
the same bio, and currenly looks at bv_offset for the offset into the
scratch folio for that.  But commit 26064d3e2b4d ("block: fix adding
folio to bio") changed how bv_page and bv_offset are calculated for
adding larger folios, breaking this fragile logic.

Switch to extracting the full physical address from the old bio_vec,
and calculate the offset into the folio from that instead.

This fixes data corruption during garbage collection with heavy rockdsb
workloads.  Thanks to Hans for tracking down the culprit commit during
long bisection sessions.

Fixes: 26064d3e2b4d ("block: fix adding folio to bio")
Fixes: 080d01c41d44 ("xfs: implement zoned garbage collection")
Reported-by: Hans Holmberg <Hans.Holmberg@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hans Holmberg <Hans.Holmberg@wdc.com>
Tested-by: Hans Holmberg <Hans.Holmberg@wdc.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_zone_gc.c