* [PATCH 2/2] Btrfs: fix unclosed transaction handler when the async transaction commitment fails
@ 2013-03-04 9:45 Miao Xie
0 siblings, 0 replies; only message in thread
From: Miao Xie @ 2013-03-04 9:45 UTC (permalink / raw)
To: Linux Btrfs
If the async transaction commitment failed, we need close the
current transaction handler, or the current transaction will be
blocked to commit because of this orphan handler.
We fix the problem by doing sync transaction commitment, that is
to invoke btrfs_commit_transaction().
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
---
fs/btrfs/ioctl.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 94c0e42..3fdfabc 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -527,6 +527,8 @@ fail:
if (async_transid) {
*async_transid = trans->transid;
err = btrfs_commit_transaction_async(trans, root, 1);
+ if (err)
+ err = btrfs_commit_transaction(trans, root);
} else {
err = btrfs_commit_transaction(trans, root);
}
@@ -592,6 +594,8 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir,
*async_transid = trans->transid;
ret = btrfs_commit_transaction_async(trans,
root->fs_info->extent_root, 1);
+ if (ret)
+ ret = btrfs_commit_transaction(trans, root);
} else {
ret = btrfs_commit_transaction(trans,
root->fs_info->extent_root);
--
1.6.5.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-03-04 9:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-04 9:45 [PATCH 2/2] Btrfs: fix unclosed transaction handler when the async transaction commitment fails Miao Xie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).