Commit 0aeeeb79 authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: always set args->value in xfs_attri_item_recover

Always set args->value to the recovered value buffer.  This reduces the
amount of code in the switch statement, and hence the amount of thinking
that I have to do.  We validated the recovered buffers, supposedly.
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent 1c7f09d2
...@@ -572,6 +572,8 @@ xfs_attri_recover_work( ...@@ -572,6 +572,8 @@ xfs_attri_recover_work(
args->name = nv->name.i_addr; args->name = nv->name.i_addr;
args->namelen = nv->name.i_len; args->namelen = nv->name.i_len;
args->hashval = xfs_da_hashname(args->name, args->namelen); args->hashval = xfs_da_hashname(args->name, args->namelen);
args->value = nv->value.i_addr;
args->valuelen = nv->value.i_len;
args->attr_filter = attrp->alfi_attr_filter & XFS_ATTRI_FILTER_MASK; args->attr_filter = attrp->alfi_attr_filter & XFS_ATTRI_FILTER_MASK;
args->op_flags = XFS_DA_OP_RECOVERY | XFS_DA_OP_OKNOENT | args->op_flags = XFS_DA_OP_RECOVERY | XFS_DA_OP_OKNOENT |
XFS_DA_OP_LOGGED; XFS_DA_OP_LOGGED;
...@@ -580,8 +582,6 @@ xfs_attri_recover_work( ...@@ -580,8 +582,6 @@ xfs_attri_recover_work(
switch (xfs_attr_intent_op(attr)) { switch (xfs_attr_intent_op(attr)) {
case XFS_ATTRI_OP_FLAGS_SET: case XFS_ATTRI_OP_FLAGS_SET:
case XFS_ATTRI_OP_FLAGS_REPLACE: case XFS_ATTRI_OP_FLAGS_REPLACE:
args->value = nv->value.i_addr;
args->valuelen = nv->value.i_len;
args->total = xfs_attr_calc_size(args, &local); args->total = xfs_attr_calc_size(args, &local);
if (xfs_inode_hasattr(args->dp)) if (xfs_inode_hasattr(args->dp))
attr->xattri_dela_state = xfs_attr_init_replace_state(args); attr->xattri_dela_state = xfs_attr_init_replace_state(args);
......
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