]> www.infradead.org Git - users/hch/xfs.git/commitdiff
xfs: don't fail repairs on metadata files with no attr fork
authorDarrick J. Wong <djwong@kernel.org>
Wed, 7 Aug 2024 22:54:21 +0000 (15:54 -0700)
committerChristoph Hellwig <hch@lst.de>
Sun, 22 Sep 2024 06:07:19 +0000 (08:07 +0200)
Fix a minor bug where we fail repairs on metadata files that do not have
attr forks because xrep_metadata_inode_subtype doesn't filter ENOENT.

Fixes: 5a8e07e799721 ("xfs: repair the inode core and forks of a metadata inode")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/scrub/repair.c

index 3b4f6c207576a639bf763051ca4ef81b2489784a..646ac8ade88d0b60a9124131655bc71862109b86 100644 (file)
@@ -1083,9 +1083,11 @@ xrep_metadata_inode_forks(
                return error;
 
        /* Make sure the attr fork looks ok before we delete it. */
-       error = xrep_metadata_inode_subtype(sc, XFS_SCRUB_TYPE_BMBTA);
-       if (error)
-               return error;
+       if (xfs_inode_hasattr(sc->ip)) {
+               error = xrep_metadata_inode_subtype(sc, XFS_SCRUB_TYPE_BMBTA);
+               if (error)
+                       return error;
+       }
 
        /* Clear the reflink flag since metadata never shares. */
        if (xfs_is_reflink_inode(sc->ip)) {