X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=inode-map.c;h=9000e69b8d6fa5931840a6d793ced91baeb10a81;hb=c9581107856ac932817c4bb832042c968af45394;hp=346952b7414418252c14c53d09f6c1527deebce4;hpb=eccf7aa62e638c627c05852cf5cac5ad0c951279;p=platform%2Fupstream%2Fbtrfs-progs.git diff --git a/inode-map.c b/inode-map.c index 346952b..9000e69 100644 --- a/inode-map.c +++ b/inode-map.c @@ -19,6 +19,7 @@ #include "ctree.h" #include "disk-io.h" #include "transaction.h" +#include "internal.h" /* * walks the btree of allocated inodes and find a hole. @@ -38,7 +39,9 @@ int btrfs_find_free_objectid(struct btrfs_trans_handle *trans, u64 search_start = dirid; path = btrfs_alloc_path(); - BUG_ON(!path); + if (!path) + return -ENOMEM; + search_start = root->last_inode_alloc; search_start = max((unsigned long long)search_start, BTRFS_FIRST_FREE_OBJECTID);