From: Darrick J. Wong Date: Mon, 4 May 2020 21:06:27 +0000 (-0700) Subject: xfs: clean up the error handling in xfs_swap_extents X-Git-Tag: v4.19.129~124 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=c69572fd2ae04ca8f44336a0d602decf3ab3b689;p=wrapfs-5.10.y.git xfs: clean up the error handling in xfs_swap_extents [ Upstream commit 8bc3b5e4b70d28f8edcafc3c9e4de515998eea9e ] Make sure we release resources properly if we cannot clean out the COW extents in preparation for an extent swap. Fixes: 96987eea537d6c ("xfs: cancel COW blocks before swapext") Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Sasha Levin --- diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index e638740f1681..3e1dd66bd676 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -1823,7 +1823,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; } /*