mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	btrfs: add missing unlocks to transaction abort paths
Added in commit 49b25e0540
("btrfs: enhance transaction abort infrastructure")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
			
			
This commit is contained in:
		
							parent
							
								
									8d082fb727
								
							
						
					
					
						commit
						871383be59
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
					@ -73,8 +73,10 @@ static noinline int join_transaction(struct btrfs_root *root, int nofail)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	cur_trans = root->fs_info->running_transaction;
 | 
						cur_trans = root->fs_info->running_transaction;
 | 
				
			||||||
	if (cur_trans) {
 | 
						if (cur_trans) {
 | 
				
			||||||
		if (cur_trans->aborted)
 | 
							if (cur_trans->aborted) {
 | 
				
			||||||
 | 
								spin_unlock(&root->fs_info->trans_lock);
 | 
				
			||||||
			return cur_trans->aborted;
 | 
								return cur_trans->aborted;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		atomic_inc(&cur_trans->use_count);
 | 
							atomic_inc(&cur_trans->use_count);
 | 
				
			||||||
		atomic_inc(&cur_trans->num_writers);
 | 
							atomic_inc(&cur_trans->num_writers);
 | 
				
			||||||
		cur_trans->num_joined++;
 | 
							cur_trans->num_joined++;
 | 
				
			||||||
| 
						 | 
					@ -1400,6 +1402,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
 | 
				
			||||||
	ret = commit_fs_roots(trans, root);
 | 
						ret = commit_fs_roots(trans, root);
 | 
				
			||||||
	if (ret) {
 | 
						if (ret) {
 | 
				
			||||||
		mutex_unlock(&root->fs_info->tree_log_mutex);
 | 
							mutex_unlock(&root->fs_info->tree_log_mutex);
 | 
				
			||||||
 | 
							mutex_unlock(&root->fs_info->reloc_mutex);
 | 
				
			||||||
		goto cleanup_transaction;
 | 
							goto cleanup_transaction;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1411,6 +1414,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
 | 
				
			||||||
	ret = commit_cowonly_roots(trans, root);
 | 
						ret = commit_cowonly_roots(trans, root);
 | 
				
			||||||
	if (ret) {
 | 
						if (ret) {
 | 
				
			||||||
		mutex_unlock(&root->fs_info->tree_log_mutex);
 | 
							mutex_unlock(&root->fs_info->tree_log_mutex);
 | 
				
			||||||
 | 
							mutex_unlock(&root->fs_info->reloc_mutex);
 | 
				
			||||||
		goto cleanup_transaction;
 | 
							goto cleanup_transaction;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue