Kaynağa Gözat

Btrfs: unlock extent and pages on error in cow_file_range

When I converted the BUG_ON() for the free_space_cache_inode in cow_file_range I
made it so we just return an error instead of unlocking all of our various
stuff.  This is a mistake and causes us to hang when we run into this.  This
patch fixes this problem.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
Josef Bacik 11 yıl önce
ebeveyn
işleme
29bce2f399
1 değiştirilmiş dosya ile 2 ekleme ve 1 silme
  1. 2 1
      fs/btrfs/inode.c

+ 2 - 1
fs/btrfs/inode.c

@@ -864,7 +864,8 @@ static noinline int cow_file_range(struct inode *inode,
 
 
 	if (btrfs_is_free_space_inode(inode)) {
 	if (btrfs_is_free_space_inode(inode)) {
 		WARN_ON_ONCE(1);
 		WARN_ON_ONCE(1);
-		return -EINVAL;
+		ret = -EINVAL;
+		goto out_unlock;
 	}
 	}
 
 
 	num_bytes = ALIGN(end - start + 1, blocksize);
 	num_bytes = ALIGN(end - start + 1, blocksize);