From patchwork Fri Jun 19 14:31:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 223875 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,URIBL_BLOCKED,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 81D69C433E0 for ; Fri, 19 Jun 2020 16:05:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 561F020757 for ; Fri, 19 Jun 2020 16:05:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592582705; bh=lEeeKBxplz5FgSvU1ng/boqItzocpThyosLQT7sUdYk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=1q65X8KZrsShzkfQiWHPYmkRVvlOz+jPdb99Rg7fEWQmUVos55K6qlCuDJrY9aHUY 0ibxnE8C08nUcw1iCghzzfMhWLNpMmT4YWJxmRB7GqmhB/pWjZvYIEhTSH8Tp+jE+L KamV3PSujVxPlB1K+RLlJfnmtIHvaiZguURAJaZU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390083AbgFSQFE (ORCPT ); Fri, 19 Jun 2020 12:05:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:39842 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391516AbgFSPKB (ORCPT ); Fri, 19 Jun 2020 11:10:01 -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 7FE8F21941; Fri, 19 Jun 2020 15:10:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592579401; bh=lEeeKBxplz5FgSvU1ng/boqItzocpThyosLQT7sUdYk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GlJtrSdyEk+ZnmquKf6EghQgffh1k19EYSpesM+10lgYRjdoxNxVqEPy7exyvk+go ja19XiOKXb8V2KpDqIig7qKURjb6FtzC1AzWjR5wOLmmCx83jvcZCZvRKYrK4r4amy jgDRrNSuSj1qCrhWQS+dfZSKIgp7dRn2JKA6P83I= 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 5.4 092/261] xfs: clean up the error handling in xfs_swap_extents Date: Fri, 19 Jun 2020 16:31:43 +0200 Message-Id: <20200619141654.289574697@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141649.878808811@linuxfoundation.org> References: <20200619141649.878808811@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 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 4f443703065e..0c71acc1b831 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -1760,7 +1760,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; } /*