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=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 BA6F6C48BCF for ; Tue, 8 Jun 2021 18:41:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A231761380 for ; Tue, 8 Jun 2021 18:41:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235325AbhFHSnB (ORCPT ); Tue, 8 Jun 2021 14:43:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:36164 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235226AbhFHSjX (ORCPT ); Tue, 8 Jun 2021 14:39:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E21C361428; Tue, 8 Jun 2021 18:33:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177240; bh=Q+50u6VEuJUsIO+N+ebG9YGoOmGd3HBkI4NM1u3jKvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W8a7Uki0n4atcEsDsA7rriskitw1NxFRzl91K4rn5YSS8z6gcZschCxwYWEDn7XI9 k0hjPHSoFeYJBBJZyhq6qMW/27QUUdVgXUE+o664zAcPNVAR6VpwZ3w4+5XIqRvC3V TgPpe1ZpLia8v0Db4M1kZ2NBWV63PKpfxbg2/wTc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qu Wenruo , Josef Bacik , David Sterba Subject: [PATCH 4.19 37/58] btrfs: return errors from btrfs_del_csums in cleanup_ref_head Date: Tue, 8 Jun 2021 20:27:18 +0200 Message-Id: <20210608175933.496836042@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175932.263480586@linuxfoundation.org> References: <20210608175932.263480586@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Josef Bacik commit 856bd270dc4db209c779ce1e9555c7641ffbc88e upstream. We are unconditionally returning 0 in cleanup_ref_head, despite the fact that btrfs_del_csums could fail. We need to return the error so the transaction gets aborted properly, fix this by returning ret from btrfs_del_csums in cleanup_ref_head. Reviewed-by: Qu Wenruo CC: stable@vger.kernel.org # 4.19+ Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/extent-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -2501,7 +2501,7 @@ static int cleanup_ref_head(struct btrfs head->qgroup_reserved); btrfs_delayed_ref_unlock(head); btrfs_put_delayed_ref_head(head); - return 0; + return ret; } /*