aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_zone_alloc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2025-11-01 10:04:35 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2025-11-01 10:04:35 -0700
commit9db0d7c5a5be25e56c3eacc1f03d296b7b0b960f (patch)
tree391eeeb5bfa6c8bb80b9b6159c5349120d8abb10 /fs/xfs/xfs_zone_alloc.c
parentMerge tag 'kbuild-fixes-6.18-2' of git://git.kernel.org/pub/scm/linux/kernel/... (diff)
parentxfs: document another racy GC case in xfs_zoned_map_extent (diff)
downloadlinux-9db0d7c5a5be25e56c3eacc1f03d296b7b0b960f.tar.gz
linux-9db0d7c5a5be25e56c3eacc1f03d296b7b0b960f.zip
Merge tag 'xfs-fixes-6.18-rc4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull xfs fixes from Carlos Maiolino: "Just a single bug fix (and documentation for the issue)" * tag 'xfs-fixes-6.18-rc4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: document another racy GC case in xfs_zoned_map_extent xfs: prevent gc from picking the same zone twice
Diffstat (limited to 'fs/xfs/xfs_zone_alloc.c')
-rw-r--r--fs/xfs/xfs_zone_alloc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/xfs/xfs_zone_alloc.c b/fs/xfs/xfs_zone_alloc.c
index 23cdab4515bb..040402240807 100644
--- a/fs/xfs/xfs_zone_alloc.c
+++ b/fs/xfs/xfs_zone_alloc.c
@@ -246,6 +246,14 @@ xfs_zoned_map_extent(
* If a data write raced with this GC write, keep the existing data in
* the data fork, mark our newly written GC extent as reclaimable, then
* move on to the next extent.
+ *
+ * Note that this can also happen when racing with operations that do
+ * not actually invalidate the data, but just move it to a different
+ * inode (XFS_IOC_EXCHANGE_RANGE), or to a different offset inside the
+ * inode (FALLOC_FL_COLLAPSE_RANGE / FALLOC_FL_INSERT_RANGE). If the
+ * data was just moved around, GC fails to free the zone, but the zone
+ * becomes a GC candidate again as soon as all previous GC I/O has
+ * finished and these blocks will be moved out eventually.
*/
if (old_startblock != NULLFSBLOCK &&
old_startblock != data.br_startblock)