summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_attr_item.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2022-05-12 15:12:55 +1000
committerDave Chinner <david@fromorbit.com>2022-05-12 15:12:55 +1000
commit4e3d96a57a06f20f4ce04a92422cc100251f346d (patch)
tree1f47c2c00dc01cc115b6f6266f0bb208608312ae /fs/xfs/xfs_attr_item.c
parentb11fa61bc4c679172a35e48d149f797ee37db3fc (diff)
xfs: xfs_attr_set_iter() does not need to return EAGAIN
Now that the full xfs_attr_set_iter() state machine always terminates with either the state being XFS_DAS_DONE on success or an error on failure, we can get rid of the need for it to return -EAGAIN whenever it needs to roll the transaction before running the next state. That is, we don't need to spray -EAGAIN return states everywhere, the caller just check the state machine state for completion to determine what action should be taken next. This greatly simplifies the code within the state machine implementation as it now only has to handle 0 for success or -errno for error and it doesn't need to tell the caller to retry. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Allison Henderson<allison.henderson@oracle.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_attr_item.c')
-rw-r--r--fs/xfs/xfs_attr_item.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/xfs_attr_item.c b/fs/xfs/xfs_attr_item.c
index f058b034ee34..1bf812830a5d 100644
--- a/fs/xfs/xfs_attr_item.c
+++ b/fs/xfs/xfs_attr_item.c
@@ -320,6 +320,8 @@ xfs_xattri_finish_update(
case XFS_ATTR_OP_FLAGS_SET:
case XFS_ATTR_OP_FLAGS_REPLACE:
error = xfs_attr_set_iter(attr);
+ if (!error && attr->xattri_dela_state != XFS_DAS_DONE)
+ error = -EAGAIN;
break;
case XFS_ATTR_OP_FLAGS_REMOVE:
ASSERT(XFS_IFORK_Q(args->dp));