Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360490
b: refs/heads/master
c: f094ac3
h: refs/heads/master
v: v3
  • Loading branch information
Liu Bo authored and Josef Bacik committed Feb 28, 2013
1 parent 16925c9 commit 4b88af8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3321719ed67440bba1b0c5ae19c30d640263ccc8
refs/heads/master: f094ac32aba3a51c00e970a2ea029339af2ca048
8 changes: 7 additions & 1 deletion trunk/fs/btrfs/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -1447,6 +1447,7 @@ static void cleanup_transaction(struct btrfs_trans_handle *trans,
struct btrfs_root *root, int err)
{
struct btrfs_transaction *cur_trans = trans->transaction;
DEFINE_WAIT(wait);

WARN_ON(trans->use_count > 1);

Expand All @@ -1455,8 +1456,13 @@ static void cleanup_transaction(struct btrfs_trans_handle *trans,
spin_lock(&root->fs_info->trans_lock);
list_del_init(&cur_trans->list);
if (cur_trans == root->fs_info->running_transaction) {
root->fs_info->trans_no_join = 1;
spin_unlock(&root->fs_info->trans_lock);
wait_event(cur_trans->writer_wait,
atomic_read(&cur_trans->num_writers) == 1);

spin_lock(&root->fs_info->trans_lock);
root->fs_info->running_transaction = NULL;
root->fs_info->trans_no_join = 0;
}
spin_unlock(&root->fs_info->trans_lock);

Expand Down

0 comments on commit 4b88af8

Please sign in to comment.