All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] xfs: handle racing deletions in xfs_zone_gc_iter_irec
@ 2026-05-18  6:52 Hans Holmberg
  2026-05-18  7:48 ` Dave Chinner
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Hans Holmberg @ 2026-05-18  6:52 UTC (permalink / raw)
  To: Carlos Maiolino, Darrick J . Wong
  Cc: Dave Chinner, Christoph Hellwig, Damien Le Moal, linux-xfs,
	Hans Holmberg

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>
---

v2:
- handle -EINVAL in the the caller in stead of switching error code
  in xfs_imap_lookup

v1:
https://lore.kernel.org/linux-xfs/20260513063745.8067-1-hans.holmberg@wdc.com/


 fs/xfs/xfs_zone_gc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_zone_gc.c b/fs/xfs/xfs_zone_gc.c
index fedcc47048af..96f14d811db2 100644
--- a/fs/xfs/xfs_zone_gc.c
+++ b/fs/xfs/xfs_zone_gc.c
@@ -400,7 +400,7 @@ xfs_zone_gc_iter_irec(
 		/*
 		 * If the inode was already deleted, skip over it.
 		 */
-		if (error == -ENOENT) {
+		if (error == -ENOENT || error == -EINVAL) {
 			iter->rec_idx++;
 			goto retry;
 		}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-05-30  6:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-18  6:52 [PATCH v2] xfs: handle racing deletions in xfs_zone_gc_iter_irec Hans Holmberg
2026-05-18  7:48 ` Dave Chinner
2026-05-18  8:55   ` Hans Holmberg
2026-05-18  9:17     ` Damien Le Moal
2026-05-18  9:44     ` Dave Chinner
2026-05-18 12:45       ` Christoph Hellwig
2026-05-18 12:43   ` Christoph Hellwig
2026-05-19  7:15 ` Christoph Hellwig
2026-05-30  6:35 ` Carlos Maiolino

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.