]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair: examine all remote attribute blocks
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 23 May 2018 21:30:47 +0000 (16:30 -0500)
committerEric Sandeen <sandeen@redhat.com>
Wed, 23 May 2018 21:30:47 +0000 (16:30 -0500)
Examine all remote xattr values of a file, not just the XFS_ATTR_ROOT
values.  This enables us to detect and zap corrupt user xattrs, as
tested by xfs/404.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
repair/attr_repair.c

index 8b1b8a752b3cdd3d5968914e6f5f1ec4b51a6c7e..67bb41ec1a57d6efa29bd5bdf0e01e0539a26c4c 100644 (file)
@@ -537,9 +537,6 @@ process_leaf_attr_remote(
                return -1;
        }
 
-       if (!(entry->flags & XFS_ATTR_ROOT))
-               goto out;
-
        value = malloc(be32_to_cpu(remotep->valuelen));
        if (value == NULL) {
                do_warn(
@@ -555,7 +552,8 @@ process_leaf_attr_remote(
                        i, ino);
                goto bad_free_out;
        }
-       if (valuecheck(mp, (char *)&remotep->name[0], value, remotep->namelen,
+       if ((entry->flags & XFS_ATTR_ROOT) &&
+           valuecheck(mp, (char *)&remotep->name[0], value, remotep->namelen,
                                be32_to_cpu(remotep->valuelen))) {
                do_warn(
        _("remote attribute value check failed for entry %d, inode %" PRIu64 "\n"),