Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 253813
b: refs/heads/master
c: ed0ca14
h: refs/heads/master
i:
  253811: a681b40
v: v3
  • Loading branch information
Josef Bacik committed Jun 15, 2011
1 parent 634bbd9 commit d7eb6fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 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: 8351583e3f6e430ce8f71913909a96ad5cc6a2f6
refs/heads/master: ed0ca14021e5ae3147602128641aa7f742ab227c
14 changes: 11 additions & 3 deletions trunk/fs/btrfs/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -1241,12 +1241,20 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
schedule_timeout(1);

finish_wait(&cur_trans->writer_wait, &wait);
spin_lock(&root->fs_info->trans_lock);
root->fs_info->trans_no_join = 1;
spin_unlock(&root->fs_info->trans_lock);
} while (atomic_read(&cur_trans->num_writers) > 1 ||
(should_grow && cur_trans->num_joined != joined));

/*
* Ok now we need to make sure to block out any other joins while we
* commit the transaction. We could have started a join before setting
* no_join so make sure to wait for num_writers to == 1 again.
*/
spin_lock(&root->fs_info->trans_lock);
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);

ret = create_pending_snapshots(trans, root->fs_info);
BUG_ON(ret);

Expand Down

0 comments on commit d7eb6fa

Please sign in to comment.