]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfs: don't fail repairs on metadata files with no attr fork
authorDarrick J. Wong <djwong@kernel.org>
Thu, 17 Oct 2024 18:58:10 +0000 (11:58 -0700)
committerCarlos Maiolino <cem@kernel.org>
Tue, 22 Oct 2024 11:37:18 +0000 (13:37 +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.

Cc: stable@vger.kernel.org # v6.8
Fixes: 5a8e07e799721b ("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>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/scrub/repair.c

index 67478294f11ae8616195f259a841cdede1f5d2f9..155bbaaa496e44236a108128c4e7e69ed998dfd3 100644 (file)
@@ -1084,9 +1084,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)) {