aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_bmap.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_bmap.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 '')
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 68ea1f4b9c3f..bc73375769a0 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -1057,6 +1057,8 @@ xfs_bmap_add_attrfork(
rsvd ? XFS_TRANS_RESERVE : 0, &tp);
if (error)
return error;
+ xfs_defer_init(&dfops, &firstblock);
+ tp->t_dfops = &dfops;
xfs_ilock(ip, XFS_ILOCK_EXCL);
error = xfs_trans_reserve_quota_nblks(tp, ip, blks, 0, rsvd ?
@@ -1104,7 +1106,6 @@ xfs_bmap_add_attrfork(
ip->i_afp = kmem_zone_zalloc(xfs_ifork_zone, KM_SLEEP);
ip->i_afp->if_flags = XFS_IFEXTENTS;
logflags = 0;
- xfs_defer_init(&dfops, &firstblock);
switch (ip->i_d.di_format) {
case XFS_DINODE_FMT_LOCAL:
error = xfs_bmap_add_attrfork_local(tp, ip, &firstblock, &dfops,