diff options
author | Brian Foster <bfoster@redhat.com> | 2018-07-11 22:26:09 -0700 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-07-11 22:26:09 -0700 |
commit | 40d03ac6aa2bebe05190462734690472310167e4 (patch) | |
tree | 7c1152d55ed3cdbcdec9ece5888e7d74621a2b14 /fs/xfs/libxfs/xfs_bmap.c | |
parent | 813d08cb6de0af43da40393aebff914d2de9e50e (diff) | |
download | linux-40d03ac6aa2bebe05190462734690472310167e4.tar.gz linux-40d03ac6aa2bebe05190462734690472310167e4.tar.bz2 linux-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_bmap.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_bmap.c | 3 |
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, |