Skip to content

Commit 871383b

Browse files
committed
btrfs: add missing unlocks to transaction abort paths
Added in commit 49b25e0 ("btrfs: enhance transaction abort infrastructure") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David Sterba <dsterba@suse.cz>
1 parent 8d082fb commit 871383b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fs/btrfs/transaction.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,10 @@ static noinline int join_transaction(struct btrfs_root *root, int nofail)
7373

7474
cur_trans = root->fs_info->running_transaction;
7575
if (cur_trans) {
76-
if (cur_trans->aborted)
76+
if (cur_trans->aborted) {
77+
spin_unlock(&root->fs_info->trans_lock);
7778
return cur_trans->aborted;
79+
}
7880
atomic_inc(&cur_trans->use_count);
7981
atomic_inc(&cur_trans->num_writers);
8082
cur_trans->num_joined++;
@@ -1400,6 +1402,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
14001402
ret = commit_fs_roots(trans, root);
14011403
if (ret) {
14021404
mutex_unlock(&root->fs_info->tree_log_mutex);
1405+
mutex_unlock(&root->fs_info->reloc_mutex);
14031406
goto cleanup_transaction;
14041407
}
14051408

@@ -1411,6 +1414,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
14111414
ret = commit_cowonly_roots(trans, root);
14121415
if (ret) {
14131416
mutex_unlock(&root->fs_info->tree_log_mutex);
1417+
mutex_unlock(&root->fs_info->reloc_mutex);
14141418
goto cleanup_transaction;
14151419
}
14161420

0 commit comments

Comments
 (0)