]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: handle racing deletions in xfs_zone_gc_iter_irec
authorHans Holmberg <hans.holmberg@wdc.com>
Mon, 18 May 2026 06:52:24 +0000 (08:52 +0200)
committerCarlos Maiolino <cem@kernel.org>
Sat, 30 May 2026 06:26:17 +0000 (08:26 +0200)
Under heavy garbage collection pressure from RocksDB workloads,
filesystem shutdowns can occur in xfs_zone_gc_iter_irec when
xfs_iget() returns -EINVAL for deleted files.

Fix this by handling -EINVAL just like we handle -ENOENT, allowing
zone GC to safely ignore stale mappings.

Fixes: 080d01c41d44 ("xfs: implement zoned garbage collection")
Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_zone_gc.c

index c8a1d5c0332c52982732704f4160c2b2b2c0b3a4..f03211e4354adccb82aebb77e4f3a23cff047922 100644 (file)
@@ -400,7 +400,7 @@ retry:
                /*
                 * If the inode was already deleted, skip over it.
                 */
-               if (error == -ENOENT) {
+               if (error == -ENOENT || error == -EINVAL) {
                        iter->rec_idx++;
                        goto retry;
                }