diff options
author | Mark Fasheh <mfasheh@suse.com> | 2011-07-12 11:10:23 -0700 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2011-07-14 14:14:45 -0700 |
commit | 17e9f796bd92cddec17d781c459376f82340fa44 (patch) | |
tree | 14c360f6adaef5c83299ec49fe2fb00dbafea1ee /fs/btrfs | |
parent | 1748f843a0190ef4332d03a64263f383af72682b (diff) | |
download | blackbird-op-linux-17e9f796bd92cddec17d781c459376f82340fa44.tar.gz blackbird-op-linux-17e9f796bd92cddec17d781c459376f82340fa44.zip |
btrfs: Don't BUG_ON alloc_path errors in btrfs_balance()
Dealing with this seems trivial - the only caller of btrfs_balance() is
btrfs_ioctl() which passes the error code directly back to userspace. There
also isn't much state to unwind (if I'm wrong about this point, we can
always safely move the allocation to the top of btrfs_balance() anyway).
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/volumes.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 19450bc53632..530a2fcea1ef 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -2061,8 +2061,10 @@ int btrfs_balance(struct btrfs_root *dev_root) /* step two, relocate all the chunks */ path = btrfs_alloc_path(); - BUG_ON(!path); - + if (!path) { + ret = -ENOMEM; + goto error; + } key.objectid = BTRFS_FIRST_CHUNK_TREE_OBJECTID; key.offset = (u64)-1; key.type = BTRFS_CHUNK_ITEM_KEY; |