Btrfs: unlock the trans lock properly
authorJosef Bacik <josef@redhat.com>
Thu, 9 Jun 2011 14:15:17 +0000 (10:15 -0400)
committerJosef Bacik <josef@redhat.com>
Thu, 9 Jun 2011 14:15:17 +0000 (10:15 -0400)
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>
fs/btrfs/transaction.c

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