From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E56B0C433E0 for ; Fri, 19 Jun 2020 14:59:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B82E721924 for ; Fri, 19 Jun 2020 14:59:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592578758; bh=pH+IlbLgRfyU1pQmglcHZtvpVaCSX5GzX1nt6hbOdp0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=qYGawqB7eaQE57SqtFrfSBM9FXHta8zbLuU9bPgvg09d0CS45w6nKMhGxvfttsRSH aMUQ4IIxt8p2mQOlcCflz+T8nzKdZ7ZhipvXj1GouH92obssHxCgf3nljdkmZhF6Wj nR+ia8JUWaJVMC93APCw02MOjuc/7j25GmxRkPu8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390491AbgFSO7O (ORCPT ); Fri, 19 Jun 2020 10:59:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:55276 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388538AbgFSO7M (ORCPT ); Fri, 19 Jun 2020 10:59:12 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2739021941; Fri, 19 Jun 2020 14:59:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592578751; bh=pH+IlbLgRfyU1pQmglcHZtvpVaCSX5GzX1nt6hbOdp0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tccfUuxgsofiLmv2j3ZyD5bY5ejRmIwgBvQx0aenT3DbBXQHwxTzzh0UE4V3RRW/+ dGHMox7S500f3C/1zhNknUDLG75UIT200YB64iMtj64g5i808PmXvJ9Y6uba96UTQ3 11IPmEiJr5MEYiFbTusMWP0C5qjcrJ6AIvRoaEtM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Darrick J. Wong" , Christoph Hellwig , Sasha Levin Subject: [PATCH 4.19 142/267] xfs: clean up the error handling in xfs_swap_extents Date: Fri, 19 Jun 2020 16:32:07 +0200 Message-Id: <20200619141655.639066679@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141648.840376470@linuxfoundation.org> References: <20200619141648.840376470@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Darrick J. Wong [ 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 --- fs/xfs/xfs_bmap_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } /* -- 2.25.1