aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2012-04-02 12:31:37 -0400
committerDavid Sterba <dsterba@suse.cz>2012-04-18 13:22:14 -0400
commit871383be592ba7e819d27556591e315a0df38cee (patch)
tree0f0c2bc7ecf2d70a5ffa842001d70b5b0f8958d0 /fs/btrfs
parent8d082fb727ac11930ea20bf1612e334ea7c2b697 (diff)
btrfs: add missing unlocks to transaction abort paths
Added in commit 49b25e0540904be0bf558b84475c69d72e4de66e ("btrfs: enhance transaction abort infrastructure") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/transaction.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 11b77a59db62..36422254ef67 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -73,8 +73,10 @@ loop:
73 73
74 cur_trans = root->fs_info->running_transaction; 74 cur_trans = root->fs_info->running_transaction;
75 if (cur_trans) { 75 if (cur_trans) {
76 if (cur_trans->aborted) 76 if (cur_trans->aborted) {
77 spin_unlock(&root->fs_info->trans_lock);
77 return cur_trans->aborted; 78 return cur_trans->aborted;
79 }
78 atomic_inc(&cur_trans->use_count); 80 atomic_inc(&cur_trans->use_count);
79 atomic_inc(&cur_trans->num_writers); 81 atomic_inc(&cur_trans->num_writers);
80 cur_trans->num_joined++; 82 cur_trans->num_joined++;
@@ -1400,6 +1402,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
1400 ret = commit_fs_roots(trans, root); 1402 ret = commit_fs_roots(trans, root);
1401 if (ret) { 1403 if (ret) {
1402 mutex_unlock(&root->fs_info->tree_log_mutex); 1404 mutex_unlock(&root->fs_info->tree_log_mutex);
1405 mutex_unlock(&root->fs_info->reloc_mutex);
1403 goto cleanup_transaction; 1406 goto cleanup_transaction;
1404 } 1407 }
1405 1408
@@ -1411,6 +1414,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
1411 ret = commit_cowonly_roots(trans, root); 1414 ret = commit_cowonly_roots(trans, root);
1412 if (ret) { 1415 if (ret) {
1413 mutex_unlock(&root->fs_info->tree_log_mutex); 1416 mutex_unlock(&root->fs_info->tree_log_mutex);
1417 mutex_unlock(&root->fs_info->reloc_mutex);
1414 goto cleanup_transaction; 1418 goto cleanup_transaction;
1415 } 1419 }
1416 1420