]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: don't return EFSCORRUPTED when scrubbing corrupt parent pointers
authorDarrick J. Wong <djwong@kernel.org>
Mon, 27 Jul 2026 05:23:31 +0000 (22:23 -0700)
committerCarlos Maiolino <cem@kernel.org>
Mon, 3 Aug 2026 08:17:34 +0000 (10:17 +0200)
LOLLM noticed that scrub sets the CORRUPT flag when xfs_parent_from_attr
thinks it's been given a corrupt parent pointer.  This eliminates the
potential to repair the filesystem because that error code is bubbled up
the call stack.  Fix this by collapsing them all to ECANCELED in
xchk_parent_pptr, which doesn't have that trait.

Cc: stable@vger.kernel.org # v6.10
Fixes: 0d29a20fbdba89 ("xfs: scrub parent pointers")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/scrub/parent.c

index a8c4807e1d9464a53930aaa8ace0084f66ae4ad2..99b60773b7158dbc99d606650d872b908f521b73 100644 (file)
@@ -485,7 +485,7 @@ xchk_parent_scan_attr(
                        valuelen, &parent_ino, NULL);
        if (error) {
                xchk_fblock_set_corrupt(sc, XFS_ATTR_FORK, 0);
-               return error;
+               return -ECANCELED;
        }
 
        /* No self-referential parent pointers. */