diff options
author | Dave Chinner <dchinner@redhat.com> | 2018-05-09 07:49:10 -0700 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-05-10 08:56:46 -0700 |
commit | 844e5e74c1a8256f2b0f89642ed9847b04fe2450 (patch) | |
tree | acd86154c8dbe847b1ba3382be1568748db97be4 /fs/xfs/xfs_reflink.c | |
parent | c5295c6aad536ba7c257016632792f3031c21182 (diff) | |
download | lwn-844e5e74c1a8256f2b0f89642ed9847b04fe2450.tar.gz lwn-844e5e74c1a8256f2b0f89642ed9847b04fe2450.zip |
xfs: fix double ijoin in xfs_reflink_clear_inode_flag()
xfs_reflink_clear_inode_flag double-joins an inode to a transaction,
which is not allowed. Fix that and document that the caller must have
already joined it.
Signed-Off-By: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
[darrick: edit out trace for nonexistent ASSERT]
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_reflink.c')
-rw-r--r-- | fs/xfs/xfs_reflink.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c index bce2b5351d64..12d441a73b53 100644 --- a/fs/xfs/xfs_reflink.c +++ b/fs/xfs/xfs_reflink.c @@ -1553,7 +1553,12 @@ next: return 0; } -/* Clear the inode reflink flag if there are no shared extents. */ +/* + * Clear the inode reflink flag if there are no shared extents. + * + * The caller is responsible for joining the inode to the transaction passed in. + * The inode will be joined to the transaction that is returned to the caller. + */ int xfs_reflink_clear_inode_flag( struct xfs_inode *ip, @@ -1572,7 +1577,6 @@ xfs_reflink_clear_inode_flag( * We didn't find any shared blocks so turn off the reflink flag. * First, get rid of any leftover CoW mappings. */ - xfs_trans_ijoin(*tpp, ip, 0); error = xfs_reflink_cancel_cow_blocks(ip, tpp, 0, NULLFILEOFF, true); if (error) return error; |