From: Darrick J. Wong Date: Tue, 9 Jul 2024 02:15:48 +0000 (-0700) Subject: xfs: don't fail repairs on metadata files with no attr fork X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c51b82603e66cefe47283de4a0a8ed6cd16a70a7;p=users%2Fhch%2Fxfs.git xfs: don't fail repairs on metadata files with no attr fork 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 --- diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c index 67478294f11a..155bbaaa496e 100644 --- a/fs/xfs/scrub/repair.c +++ b/fs/xfs/scrub/repair.c @@ -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)) {