Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp111298ybg; Mon, 8 Jun 2020 17:55:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhVNCpOfg/FMEY+/4sysQD2qGHRQfEndBJTGIDMFx9nxF4raScp7RtPeT2ulxMmg5DJqVt X-Received: by 2002:a17:906:5595:: with SMTP id y21mr7499336ejp.61.1591664133370; Mon, 08 Jun 2020 17:55:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591664133; cv=none; d=google.com; s=arc-20160816; b=gsRpc9UvWv563B79//UxNbHHeEx6NqsB1TtCPNyaKhnvcOE0am/hlqfeWXn6MVWKKp RmmYguIj8RRCeSkuCkM6+YIbhDPrKUg6vo6xSuLc2kf4UElzxbBHh4yu4d7VRD8wABb5 j95htAdAHi+AIq1JTnFJirMAhhgv756OiK7THVh8y4FeidX+U3uUxg7ZaUg1c8dqVC0z p6DFMpVk6TdMLTUsTq/feaiMx+w4iq3KpXMiNmxf41Ai+z+Y49Cu28OCWN83oMNWwMXy hsIcIpwGppY4n421v3gTZunI4c1I7XB5FWcFcxCUzRqTBrKZ6wjgEh9sru0X61V5B8Mg ILew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SaJ3UiIzbyWms+YQo3gVdx+q2HmNjOGhMGkk06J9B28=; b=uVcKKNZlg4oCjIXhyM3jQN4DFmgpe519r6bKgJ/Ex0Vzbjr+u+dmEzpWG5sCeAopH2 f5dpffY7VXfLuG64VIRNtqpC+EJgmuv/dE1z/k7MKXmlynCFThC+Klo8+zvQJ60tTO+V UsAOXZpEDC01XxOkadYQ11EkaCOe+1Rog0M1ruipp8ymyJb8v/ANAztmsH3/qxpIPwXf zA7STpVrOyJVNy/hRsZCJbXQFw6+3k4QIEqiuztLktVR8W7rlCbUu+gNwMX2FAagzbWf BFNz9AQ/O2be5J9LSndCD38vzkAvX5D7lj9EF3s6bUDs2o+D8WOXpVkolkk1Rx0niEI9 AqgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dGbtmQlR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx18si8133004edb.323.2020.06.08.17.55.10; Mon, 08 Jun 2020 17:55:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dGbtmQlR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728056AbgFIAxc (ORCPT + 99 others); Mon, 8 Jun 2020 20:53:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:55566 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728493AbgFHXJo (ORCPT ); Mon, 8 Jun 2020 19:09:44 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3BC99208C3; Mon, 8 Jun 2020 23:09:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657783; bh=OElQhyIJryCo7sc7zfIolQZsTrPafdjXCRJf/g/xOGE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dGbtmQlR9zxd74LislBdQ/5of/4qN01XDz1a103Ij1O/MsLDXlD9kBRYSRmieqJks +m8Sqg6d8J8qd1N2NwvIgwjOLDTYVyjYq+LyJHh+nOvOhe+l3O/N5+ZKUY4tDburjL XN8NAuwL1Is5K5FxaKo/6bGbcoE7WBmRVUvTfR3w= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Darrick J. Wong" , Christoph Hellwig , Sasha Levin , linux-xfs@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 165/274] xfs: clean up the error handling in xfs_swap_extents Date: Mon, 8 Jun 2020 19:04:18 -0400 Message-Id: <20200608230607.3361041-165-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 4f800f7fe888..cc23a3e23e2d 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -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; } /* -- 2.25.1