summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorMark Fasheh2011-09-09 02:40:01 +0200
committerDavid Sterba2012-03-22 01:45:39 +0100
commit3acd395317f22b4346a139571cd4723408c5d4af (patch)
tree2ccb38cbf20effabef8ff577be03f1414a912e32 /fs/btrfs/volumes.c
parentbtrfs: Remove BUG_ON from __btrfs_alloc_chunk() (diff)
downloadkernel-qcow2-linux-3acd395317f22b4346a139571cd4723408c5d4af.tar.gz
kernel-qcow2-linux-3acd395317f22b4346a139571cd4723408c5d4af.tar.xz
kernel-qcow2-linux-3acd395317f22b4346a139571cd4723408c5d4af.zip
btrfs: Remove BUG_ON from __finish_chunk_alloc()
btrfs_alloc_chunk() unconditionally BUGs on any error returned from __finish_chunk_alloc() so there's no need for two BUG_ON lines. Remove the one from __finish_chunk_alloc(). Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index f002973959d0..394bf15ea18c 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -3383,7 +3383,8 @@ static int __finish_chunk_alloc(struct btrfs_trans_handle *trans,
device = map->stripes[index].dev;
device->bytes_used += stripe_size;
ret = btrfs_update_device(trans, device);
- BUG_ON(ret);
+ if (ret)
+ goto out_free;
index++;
}
@@ -3430,6 +3431,7 @@ static int __finish_chunk_alloc(struct btrfs_trans_handle *trans,
item_size);
}
+out_free:
kfree(chunk);
return ret;
}