diff mbox series

[20/29] xfs: don't fail repairs on metadata files with no attr fork

Message ID 172919069796.3451313.2227454340362290952.stgit@frogsfrogsfrogs (mailing list archive)
State New
Headers show
Series [01/29] xfs: constify the xfs_sb predicates | expand

Commit Message

Darrick J. Wong Oct. 17, 2024, 6:58 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

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>
---
 fs/xfs/scrub/repair.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Greg KH Oct. 18, 2024, 6 a.m. UTC | #1
On Thu, Oct 17, 2024 at 11:58:10AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> 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>
> ---
>  fs/xfs/scrub/repair.c |    8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)

Why is a bugfix / stable-tagged-patch, number 20 in a 29 patch series?
Why isn't it first, or better yet, on it's own if it is fixing a bug
that people want merged "soon"?

thanks,

greg k-h
diff mbox series

Patch

diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
index 3b4f6c207576a6..646ac8ade88d0b 100644
--- a/fs/xfs/scrub/repair.c
+++ b/fs/xfs/scrub/repair.c
@@ -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)) {