xfs: scrub extended attributes

Scrub the hash tree, keys, and values in an extended attribute structure.
Refactor the attribute code to use the transaction if the caller supplied
one to avoid buffer deadocks.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
This commit is contained in:
Darrick J. Wong
2017-10-17 21:37:45 -07:00
parent df481968f3
commit eec0482e08
8 changed files with 285 additions and 3 deletions

View File

@@ -158,6 +158,10 @@ xfs_scrub_teardown(
iput(VFS_I(sc->ip));
sc->ip = NULL;
}
if (sc->buf) {
kmem_free(sc->buf);
sc->buf = NULL;
}
return error;
}
@@ -231,6 +235,10 @@ static const struct xfs_scrub_meta_ops meta_scrub_ops[] = {
.setup = xfs_scrub_setup_directory,
.scrub = xfs_scrub_directory,
},
{ /* extended attributes */
.setup = xfs_scrub_setup_xattr,
.scrub = xfs_scrub_xattr,
},
};
/* This isn't a stable feature, warn once per day. */