summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fb.com>2014-02-07 12:21:23 -0500
committerJosef Bacik <jbacik@fb.com>2014-03-10 15:15:53 -0400
commit29bce2f3997a8dc5195b7a7724362d1e55df7bb2 (patch)
tree7a7c02ba24263b07ddb1d0716832ff985a4f74f3 /fs/btrfs/inode.c
parentc581afc8db4e9aaa8af2246bb72c1bf72825014d (diff)
downloadlinux-29bce2f3997a8dc5195b7a7724362d1e55df7bb2.tar.bz2
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>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index a7e6690e0946..5b8925003090 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -864,7 +864,8 @@ static noinline int cow_file_range(struct inode *inode,
if (btrfs_is_free_space_inode(inode)) {
WARN_ON_ONCE(1);
- return -EINVAL;
+ ret = -EINVAL;
+ goto out_unlock;
}
num_bytes = ALIGN(end - start + 1, blocksize);