Commit a918f5f2 authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: refactor xfs_is_using_logged_xattrs checks in attr item recovery

Move this feature check down to the per-op checks so that we can ensure
that we never see parent pointer attr items on non-pptr filesystems, and
that logged xattrs are turned on for non-pptr attr items.
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent f041455e
...@@ -480,9 +480,6 @@ xfs_attri_validate( ...@@ -480,9 +480,6 @@ xfs_attri_validate(
{ {
unsigned int op = xfs_attr_log_item_op(attrp); unsigned int op = xfs_attr_log_item_op(attrp);
if (!xfs_is_using_logged_xattrs(mp))
return false;
if (attrp->__pad != 0) if (attrp->__pad != 0)
return false; return false;
...@@ -499,12 +496,16 @@ xfs_attri_validate( ...@@ -499,12 +496,16 @@ xfs_attri_validate(
switch (op) { switch (op) {
case XFS_ATTRI_OP_FLAGS_SET: case XFS_ATTRI_OP_FLAGS_SET:
case XFS_ATTRI_OP_FLAGS_REPLACE: case XFS_ATTRI_OP_FLAGS_REPLACE:
if (!xfs_is_using_logged_xattrs(mp))
return false;
if (attrp->alfi_value_len > XATTR_SIZE_MAX) if (attrp->alfi_value_len > XATTR_SIZE_MAX)
return false; return false;
if (!xfs_attri_validate_namelen(attrp->alfi_name_len)) if (!xfs_attri_validate_namelen(attrp->alfi_name_len))
return false; return false;
break; break;
case XFS_ATTRI_OP_FLAGS_REMOVE: case XFS_ATTRI_OP_FLAGS_REMOVE:
if (!xfs_is_using_logged_xattrs(mp))
return false;
if (attrp->alfi_value_len != 0) if (attrp->alfi_value_len != 0)
return false; return false;
if (!xfs_attri_validate_namelen(attrp->alfi_name_len)) if (!xfs_attri_validate_namelen(attrp->alfi_name_len))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment