xfs: clean up the error handling in xfs_swap_extents

Make sure we release resources properly if we cannot clean out the COW
extents in preparation for an extent swap.

Fixes: 96987eea53 ("xfs: cancel COW blocks before swapext")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
Darrick J. Wong 2020-05-04 14:06:27 -07:00
parent 840d493dff
commit 8bc3b5e4b7
1 changed files with 1 additions and 1 deletions

View File

@ -1606,7 +1606,7 @@ xfs_swap_extents(
if (xfs_inode_has_cow_data(tip)) {
error = xfs_reflink_cancel_cow_range(tip, 0, NULLFILEOFF, true);
if (error)
return error;
goto out_unlock;
}
/*