Browse Source

Btrfs: unlock the trans lock properly

In btrfs_wait_for_commit if we came upon a transaction that had committed we
just exited, but that's bad since we are holding the trans_lock.  So break
instead so that the lock is dropped.  Thanks,

Reported-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <josef@redhat.com>
Josef Bacik 14 years ago
parent
commit
3473f3c06a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      fs/btrfs/transaction.c

+ 1 - 1
fs/btrfs/transaction.c

@@ -349,7 +349,7 @@ int btrfs_wait_for_commit(struct btrfs_root *root, u64 transid)
 					    list) {
 					    list) {
 			if (t->in_commit) {
 			if (t->in_commit) {
 				if (t->commit_done)
 				if (t->commit_done)
-					goto out;
+					break;
 				cur_trans = t;
 				cur_trans = t;
 				atomic_inc(&cur_trans->use_count);
 				atomic_inc(&cur_trans->use_count);
 				break;
 				break;