提交 844e5e74 编写于 作者: D Dave Chinner 提交者: Darrick J. Wong

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: NDave Chinner <dchinner@redhat.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NBrian Foster <bfoster@redhat.com>
[darrick: edit out trace for nonexistent ASSERT]
Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
上级 c5295c6a
...@@ -1553,7 +1553,12 @@ xfs_reflink_inode_has_shared_extents( ...@@ -1553,7 +1553,12 @@ xfs_reflink_inode_has_shared_extents(
return 0; 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 int
xfs_reflink_clear_inode_flag( xfs_reflink_clear_inode_flag(
struct xfs_inode *ip, struct xfs_inode *ip,
...@@ -1572,7 +1577,6 @@ xfs_reflink_clear_inode_flag( ...@@ -1572,7 +1577,6 @@ xfs_reflink_clear_inode_flag(
* We didn't find any shared blocks so turn off the reflink flag. * We didn't find any shared blocks so turn off the reflink flag.
* First, get rid of any leftover CoW mappings. * 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); error = xfs_reflink_cancel_cow_blocks(ip, tpp, 0, NULLFILEOFF, true);
if (error) if (error)
return error; return error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册