mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	btrfs: don't double unlock on error in btrfs_punch_hole
If we have an error writing out a delalloc range in
btrfs_punch_hole_lock_range we'll unlock the inode and then goto
out_only_mutex, where we will again unlock the inode.  This is bad,
don't do this.
Fixes: f27451f229 ("Btrfs: add support for fallocate's zero range operation")
CC: stable@vger.kernel.org # 4.19+
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
			
			
This commit is contained in:
		
							parent
							
								
									2b90883c56
								
							
						
					
					
						commit
						8fca955057
					
				
					 1 changed files with 1 additions and 3 deletions
				
			
		| 
						 | 
					@ -2554,10 +2554,8 @@ static int btrfs_punch_hole(struct inode *inode, loff_t offset, loff_t len)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = btrfs_punch_hole_lock_range(inode, lockstart, lockend,
 | 
						ret = btrfs_punch_hole_lock_range(inode, lockstart, lockend,
 | 
				
			||||||
					  &cached_state);
 | 
										  &cached_state);
 | 
				
			||||||
	if (ret) {
 | 
						if (ret)
 | 
				
			||||||
		inode_unlock(inode);
 | 
					 | 
				
			||||||
		goto out_only_mutex;
 | 
							goto out_only_mutex;
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	path = btrfs_alloc_path();
 | 
						path = btrfs_alloc_path();
 | 
				
			||||||
	if (!path) {
 | 
						if (!path) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue