Add missing unlocks on error paths
PATCH 1/1 Add missing unlocks on error paths
Correctly drop locks during error cases.
Signed-off-by Daniel J Blueman <[email protected]>
--- fs/btrfs/transaction.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
fs/btrfs/transaction.c +6 -1
@@ -73,8 +73,11 @@ loop: cur_trans = root->fs_info->running_transaction;if (cur_trans) { -if (cur_trans->aborted) +if (cur_trans->aborted) { +spin_unlock (&root->fs_info->trans_lock);return cur_trans->aborted; + } +atomic_inc (&cur_trans->use_count);atomic_inc (&cur_trans->num_writers); cur_trans->num_joined++;
@@ -1400,6 +1403,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, ret =commit_fs_roots (trans, root);if (ret) {mutex_unlock (&root->fs_info->tree_log_mutex); +mutex_unlock (&root->fs_info->reloc_mutex); goto cleanup_transaction; }
@@ -1411,6 +1415,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, ret =commit_cowonly_roots (trans, root);if (ret) {mutex_unlock (&root->fs_info->tree_log_mutex); +mutex_unlock (&root->fs_info->reloc_mutex); goto cleanup_transaction; }
Signature · 1 line
1.7.9.5
Quoted 43 lines · Daniel J Blueman
Correctly drop locks during error cases.
Signed-off-by Daniel J Blueman <[email protected]>--- fs/btrfs/transaction.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)fs/btrfs/transaction.c +6
-1@@ -73,8 +73,11 @@ loop: cur_trans = root->fs_info->running_transaction;if (cur_trans) { -if (cur_trans->aborted) +if (cur_trans->aborted) { +spin_unlock (&root->fs_info->trans_lock);return cur_trans->aborted; + } +atomic_inc (&cur_trans->use_count);atomic_inc (&cur_trans->num_writers); cur_trans->num_joined++;@@ -1400,6 +1403,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, ret =commit_fs_roots (trans, root);if (ret) {mutex_unlock (&root->fs_info->tree_log_mutex); +mutex_unlock (&root->fs_info->reloc_mutex); goto cleanup_transaction; }@@ -1411,6 +1415,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, ret =commit_cowonly_roots (trans, root);if (ret) {mutex_unlock (&root->fs_info->tree_log_mutex); +mutex_unlock (&root->fs_info->reloc_mutex); goto cleanup_transaction; }Signature · 1 line
1.7.9.5
Reviewed-by Josef Bacik <[email protected]>
Thanks,
Josef
Quoted 4 lines · Daniel J Blueman
Correctly drop locks during error cases.
Signed-off-by Daniel J Blueman <[email protected]>---
fyi, the same patch is already present in for-linus, 871383be592ba7e819d27556591e315a0df38cee
[http://www.spinics.net/lists/linux-btrfs/msg15837.html]
david
Quoted 10 lines · David Sterba
Quoted 4 lines · Daniel J Blueman
Correctly drop locks during error cases.
Signed-off-by Daniel J Blueman <[email protected]>---
fyi, the same patch is already present in for-linus,
871383be592ba7e819d27556591e315a0df38cee
[http://www.spinics.net/lists/linux-btrfs/msg15837.html]
Hrm weird I didn't have that in btrfs-next. Thanks,
Josef