Skip to content

Commit

Permalink
btrfs: Don't BUG_ON alloc_path errors in btrfs_balance()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Fasheh committed Jul 14, 2011
1 parent 1748f84 commit 17e9f79
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 17e9f79

Please sign in to comment.