public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Davide C. C. Italiano" <dccitaliano@gmail.com>
To: linux-btrfs@vger.kernel.org
Cc: fdmanana@gmail.com, Davide Italiano <dccitaliano@gmail.com>
Subject: [PATCH 2/2] [btrfs] btrfs_rename(): don't ignore btrfs_end_transaction() return
Date: Tue, 30 Jun 2015 00:15:15 -0400	[thread overview]
Message-ID: <1435637715-16332-1-git-send-email-dccitaliano@gmail.com> (raw)
In-Reply-To: <1435528041-20878-3-git-send-email-dccitaliano@gmail.com>

From: Davide Italiano <dccitaliano@gmail.com>

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 <dccitaliano@gmail.com>
---
 fs/btrfs/inode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 59c475c..61b26be 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -9199,7 +9199,8 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
 		btrfs_end_log_trans(root);
 	}
 out_fail:
-	btrfs_end_transaction(trans, root);
+	if (!ret)
+		ret = btrfs_end_transaction(trans, root);
 out_notrans:
 	if (old_ino == BTRFS_FIRST_FREE_OBJECTID)
 		up_read(&root->fs_info->subvol_sem);
-- 
2.4.3


  parent reply	other threads:[~2015-06-30  4:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-28 21:47 [PATCH 0/2] btrfs_rename bugfixes Davide C. C. Italiano
2015-06-28 21:47 ` [PATCH 1/2] [btrfs] btrfs_rename: abort transaction in case of error Davide C. C. Italiano
2015-06-29  8:59   ` Filipe David Manana
2015-06-30  4:17     ` Davide Italiano
2015-06-30  8:26       ` Filipe David Manana
2015-06-28 21:47 ` [PATCH 2/2] [btrfs] btrfs_rename(): don't ignore btrfs_end_transaction() return Davide C. C. Italiano
2015-06-29  9:03   ` Filipe David Manana
2015-06-30  4:15   ` Davide C. C. Italiano [this message]
2015-06-30  8:24     ` Filipe David Manana

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435637715-16332-1-git-send-email-dccitaliano@gmail.com \
    --to=dccitaliano@gmail.com \
    --cc=fdmanana@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox