summaryrefslogtreecommitdiff
path: root/fs/btrfs/root-tree.c
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2011-10-04 07:22:44 +0400
committerDavid Sterba <dsterba@suse.cz>2012-03-22 04:45:33 +0400
commitb45a9d8b48e5ce534bd222007c43cbf374544f0b (patch)
treedd08cdb5dd7657a2b6f285246415e777d19e5b86 /fs/btrfs/root-tree.c
parent200a5c17677e1ee8b78382046f3748c9f5816281 (diff)
downloadlinux-b45a9d8b48e5ce534bd222007c43cbf374544f0b.tar.xz
btrfs: btrfs_update_root error push-up
btrfs_update_root BUG's when it can't alloc a path, yet it can recover from a search error. This patch returns -ENOMEM instead. Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Diffstat (limited to 'fs/btrfs/root-tree.c')
-rw-r--r--fs/btrfs/root-tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c
index 1fd93d63707f..1486cf9de1da 100644
--- a/fs/btrfs/root-tree.c
+++ b/fs/btrfs/root-tree.c
@@ -93,7 +93,9 @@ int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root
unsigned long ptr;
path = btrfs_alloc_path();
- BUG_ON(!path);
+ if (!path)
+ return -ENOMEM;
+
ret = btrfs_search_slot(trans, root, key, path, 0, 1);
if (ret < 0)
goto out;