From patchwork Sun Jun 28 21:47:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Davide Italiano X-Patchwork-Id: 6686761 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 22A05C05AC for ; Sun, 28 Jun 2015 21:48:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 48FFA2060C for ; Sun, 28 Jun 2015 21:48:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 73C7E20613 for ; Sun, 28 Jun 2015 21:48:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752470AbbF1Vrd (ORCPT ); Sun, 28 Jun 2015 17:47:33 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:33497 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752503AbbF1Vrc (ORCPT ); Sun, 28 Jun 2015 17:47:32 -0400 Received: by padev16 with SMTP id ev16so94763804pad.0 for ; Sun, 28 Jun 2015 14:47:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lTQZyF8TDE5k6UFIrq39CZo6eAjW83JiG7fb1+fcKLQ=; b=qlWkPcWASJ2KzThVna1xQ/2ZN0vJgeO0v/JsD3c34TIuaePyfJC7B6/5rXus21VuPk sPB+2I1ze5bE4BX2GhsXSwirV8/eSM1R1CR5iHQxgH3QKJhBRZzmIgPjOa5iLqpIoIYR Zjx1IddUP5K/X5b/xrZHO0RMb8m98PsO08ha3QaWMhJh8+k1sHYO9pWyDAhPxSznYsG/ tKFIYTbCbQgEq1gZemoAA8PtOMep8eF3NFlxF+4Ghyxk/HalyiGCrramtLaazvPlE4Ps X/AYx3UkoOpUXaLFdZinmvhXw9idoyHUn/lX4XyR3JFBdZQuWNVRyba6mbLidPvfUmyE 87gw== X-Received: by 10.66.193.130 with SMTP id ho2mr25054942pac.111.1435528051897; Sun, 28 Jun 2015 14:47:31 -0700 (PDT) Received: from localhost.localdomain.localdomain (c-24-7-63-120.hsd1.ca.comcast.net. [24.7.63.120]) by mx.google.com with ESMTPSA id s1sm40010745pda.54.2015.06.28.14.47.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Jun 2015 14:47:31 -0700 (PDT) From: "Davide C. C. Italiano" To: linux-btrfs@vger.kernel.org Cc: Davide Italiano Subject: [PATCH 2/2] [btrfs] btrfs_rename(): don't ignore btrfs_end_transaction() return Date: Sun, 28 Jun 2015 17:47:21 -0400 Message-Id: <1435528041-20878-3-git-send-email-dccitaliano@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1435528041-20878-1-git-send-email-dccitaliano@gmail.com> References: <1435528041-20878-1-git-send-email-dccitaliano@gmail.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Davide Italiano btrfs_end_transaction() can return an error -- this happens, e.g. if it tries to commit and the transaction was aborted in the meanhwile. Swallowing the error is wrong, so explicitly return it. Signed-off-by: Davide Italiano --- fs/btrfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 59c475c..7764132 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -9199,7 +9199,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, btrfs_end_log_trans(root); } out_fail: - btrfs_end_transaction(trans, root); + ret = btrfs_end_transaction(trans, root); out_notrans: if (old_ino == BTRFS_FIRST_FREE_OBJECTID) up_read(&root->fs_info->subvol_sem);