]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair: set aformat and anextents correctly when clearing the attr fork
authorDarrick J. Wong <djwong@kernel.org>
Tue, 12 Sep 2023 19:40:04 +0000 (12:40 -0700)
committerCarlos Maiolino <cem@kernel.org>
Thu, 5 Oct 2023 12:57:20 +0000 (14:57 +0200)
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 <djwong@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
repair/dinode.c

index e534a01b50095dd5c458569781ef0274767de29b..c10dd1fa32251e913cc8fcaa53fa239ee5224432 100644 (file)
@@ -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"));
                        }