summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_attr_list.c
diff options
context:
space:
mode:
authorDarrick J. Wong2017-10-18 06:37:45 +0200
committerDarrick J. Wong2017-10-27 00:38:26 +0200
commiteec0482e0829eab1da1be693e524c889dc4b168c (patch)
tree8c445deb09846f1dd4a888cd5ddb20539b23515a /fs/xfs/xfs_attr_list.c
parentxfs: scrub directory freespace (diff)
downloadkernel-qcow2-linux-eec0482e0829eab1da1be693e524c889dc4b168c.tar.gz
kernel-qcow2-linux-eec0482e0829eab1da1be693e524c889dc4b168c.tar.xz
kernel-qcow2-linux-eec0482e0829eab1da1be693e524c889dc4b168c.zip
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>
Diffstat (limited to 'fs/xfs/xfs_attr_list.c')
-rw-r--r--fs/xfs/xfs_attr_list.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/xfs/xfs_attr_list.c b/fs/xfs/xfs_attr_list.c
index 7740c8a5e736..581678686315 100644
--- a/fs/xfs/xfs_attr_list.c
+++ b/fs/xfs/xfs_attr_list.c
@@ -407,7 +407,8 @@ xfs_attr3_leaf_list_int(
cursor->offset = 0;
}
- if (entry->flags & XFS_ATTR_INCOMPLETE)
+ if ((entry->flags & XFS_ATTR_INCOMPLETE) &&
+ !(context->flags & ATTR_INCOMPLETE))
continue; /* skip incomplete entries */
if (entry->flags & XFS_ATTR_LOCAL) {
@@ -583,6 +584,10 @@ xfs_attr_list(
(cursor->hashval || cursor->blkno || cursor->offset))
return -EINVAL;
+ /* Only internal consumers can retrieve incomplete attrs. */
+ if (flags & ATTR_INCOMPLETE)
+ return -EINVAL;
+
/*
* Check for a properly aligned buffer.
*/