From 75325b82a66185ae9d0360193a271640e8c9a3ea Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Tue, 12 Sep 2023 12:40:04 -0700 Subject: [PATCH] xfs_repair: set aformat and anextents correctly when clearing the attr fork Ever since commit b42db0860e130 ("xfs: enhance dinode verifier"), we've required that inodes with zero di_forkoff must also have di_aformat == EXTENTS and di_naextents == 0. clear_dinode_attr actually does this, but then both callers inexplicably set di_format = LOCAL. That in turn causes a verifier failure the next time the xattrs of that file are read by the kernel. Get rid of the bogus field write. Signed-off-by: Darrick J. Wong Reviewed-by: Carlos Maiolino Reviewed-by: Bill O'Donnell Signed-off-by: Carlos Maiolino --- repair/dinode.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/repair/dinode.c b/repair/dinode.c index e534a01b5..c10dd1fa3 100644 --- a/repair/dinode.c +++ b/repair/dinode.c @@ -2078,7 +2078,6 @@ process_inode_attr_fork( if (!no_modify) { do_warn(_(", clearing attr fork\n")); *dirty += clear_dinode_attr(mp, dino, lino); - dino->di_aformat = XFS_DINODE_FMT_LOCAL; ASSERT(*dirty > 0); } else { do_warn(_(", would clear attr fork\n")); @@ -2135,7 +2134,6 @@ process_inode_attr_fork( /* clear attributes if not done already */ if (!no_modify) { *dirty += clear_dinode_attr(mp, dino, lino); - dino->di_aformat = XFS_DINODE_FMT_LOCAL; } else { do_warn(_("would clear attr fork\n")); } -- 2.47.3