aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_attr.c
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2018-07-11 22:26:09 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2018-07-11 22:26:09 -0700
commit40d03ac6aa2bebe05190462734690472310167e4 (patch)
tree7c1152d55ed3cdbcdec9ece5888e7d74621a2b14 /fs/xfs/libxfs/xfs_attr.c
parentxfs: use ->t_dfops for recovery of [b|c]ui log items (diff)
downloadlinux-dev-40d03ac6aa2bebe05190462734690472310167e4.tar.xz
linux-dev-40d03ac6aa2bebe05190462734690472310167e4.zip
xfs: use ->t_dfops for attr set/remove operations
Attach the local dfops to the transaction allocated for xattr add and remove operations. Add an earlier initialization in xfs_attr_remove() to ensure the structure is valid if it remains unused at transaction commit time. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_attr.c')
-rw-r--r--fs/xfs/libxfs/xfs_attr.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
index 99590f61d624..cc23c269f2bf 100644
--- a/fs/xfs/libxfs/xfs_attr.c
+++ b/fs/xfs/libxfs/xfs_attr.c
@@ -254,6 +254,8 @@ xfs_attr_set(
rsvd ? XFS_TRANS_RESERVE : 0, &args.trans);
if (error)
return error;
+ xfs_defer_init(&dfops, &firstblock);
+ args.trans->t_dfops = &dfops;
xfs_ilock(dp, XFS_ILOCK_EXCL);
error = xfs_trans_reserve_quota_nblks(args.trans, dp, args.total, 0,
@@ -315,7 +317,6 @@ xfs_attr_set(
* It won't fit in the shortform, transform to a leaf block.
* GROT: another possible req'mt for a double-split btree op.
*/
- xfs_defer_init(args.dfops, args.firstblock);
error = xfs_attr_shortform_to_leaf(&args, &leaf_bp);
if (error)
goto out_defer_cancel;
@@ -325,9 +326,9 @@ xfs_attr_set(
* buffer and run into problems with the write verifier.
*/
xfs_trans_bhold(args.trans, leaf_bp);
- xfs_defer_bjoin(args.dfops, leaf_bp);
- xfs_defer_ijoin(args.dfops, dp);
- error = xfs_defer_finish(&args.trans, args.dfops);
+ xfs_defer_bjoin(&dfops, leaf_bp);
+ xfs_defer_ijoin(&dfops, dp);
+ error = xfs_defer_finish(&args.trans, &dfops);
if (error)
goto out_defer_cancel;
@@ -429,6 +430,8 @@ xfs_attr_remove(
&args.trans);
if (error)
return error;
+ xfs_defer_init(&dfops, &firstblock);
+ args.trans->t_dfops = &dfops;
xfs_ilock(dp, XFS_ILOCK_EXCL);
/*