linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Btrfs: make sure to unblock the transaction when cleaning it up
@ 2012-05-31 15:14 Josef Bacik
  2012-05-31 18:30 ` Josef Bacik
  0 siblings, 1 reply; 2+ messages in thread
From: Josef Bacik @ 2012-05-31 15:14 UTC (permalink / raw)
  To: linux-btrfs

When a transaction aborts we can get stuck in places where tasks are waiting
for the transaction to become unblocked.  So we need to unblock the
transaction and wake up any waiters so they can exit properly.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
---
 fs/btrfs/transaction.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 7aed0e8..1715afb 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -1204,9 +1204,16 @@ static void cleanup_transaction(struct btrfs_trans_handle *trans,
 	WARN_ON(trans->use_count > 1);
 
 	spin_lock(&root->fs_info->trans_lock);
+	cur_trans->blocked = 0;
 	list_del_init(&cur_trans->list);
+	if (root->fs_info->running_transaction == cur_trans) {
+		root->fs_info->running_transaction = NULL;
+		root->fs_info->trans_no_join = 0;
+	}
 	spin_unlock(&root->fs_info->trans_lock);
 
+	wake_up(&root->fs_info->transaction_wait);
+
 	btrfs_cleanup_one_transaction(trans->transaction, root);
 
 	put_transaction(cur_trans);
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-31 18:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-31 15:14 [PATCH] Btrfs: make sure to unblock the transaction when cleaning it up Josef Bacik
2012-05-31 18:30 ` Josef Bacik

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).