|
@@ -1070,7 +1070,8 @@ static noinline int run_delalloc_nocow(struct inode *inode,
|
|
u64 ino = btrfs_ino(inode);
|
|
u64 ino = btrfs_ino(inode);
|
|
|
|
|
|
path = btrfs_alloc_path();
|
|
path = btrfs_alloc_path();
|
|
- BUG_ON(!path);
|
|
|
|
|
|
+ if (!path)
|
|
|
|
+ return -ENOMEM;
|
|
|
|
|
|
nolock = is_free_space_inode(root, inode);
|
|
nolock = is_free_space_inode(root, inode);
|
|
|
|
|
|
@@ -1644,7 +1645,8 @@ static int insert_reserved_file_extent(struct btrfs_trans_handle *trans,
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
path = btrfs_alloc_path();
|
|
path = btrfs_alloc_path();
|
|
- BUG_ON(!path);
|
|
|
|
|
|
+ if (!path)
|
|
|
|
+ return -ENOMEM;
|
|
|
|
|
|
path->leave_spinning = 1;
|
|
path->leave_spinning = 1;
|
|
|
|
|
|
@@ -3713,7 +3715,8 @@ static int btrfs_inode_by_name(struct inode *dir, struct dentry *dentry,
|
|
int ret = 0;
|
|
int ret = 0;
|
|
|
|
|
|
path = btrfs_alloc_path();
|
|
path = btrfs_alloc_path();
|
|
- BUG_ON(!path);
|
|
|
|
|
|
+ if (!path)
|
|
|
|
+ return -ENOMEM;
|
|
|
|
|
|
di = btrfs_lookup_dir_item(NULL, root, path, btrfs_ino(dir), name,
|
|
di = btrfs_lookup_dir_item(NULL, root, path, btrfs_ino(dir), name,
|
|
namelen, 0);
|
|
namelen, 0);
|
|
@@ -4438,7 +4441,8 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,
|
|
int owner;
|
|
int owner;
|
|
|
|
|
|
path = btrfs_alloc_path();
|
|
path = btrfs_alloc_path();
|
|
- BUG_ON(!path);
|
|
|
|
|
|
+ if (!path)
|
|
|
|
+ return ERR_PTR(-ENOMEM);
|
|
|
|
|
|
inode = new_inode(root->fs_info->sb);
|
|
inode = new_inode(root->fs_info->sb);
|
|
if (!inode) {
|
|
if (!inode) {
|
|
@@ -7194,7 +7198,11 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry,
|
|
goto out_unlock;
|
|
goto out_unlock;
|
|
|
|
|
|
path = btrfs_alloc_path();
|
|
path = btrfs_alloc_path();
|
|
- BUG_ON(!path);
|
|
|
|
|
|
+ if (!path) {
|
|
|
|
+ err = -ENOMEM;
|
|
|
|
+ drop_inode = 1;
|
|
|
|
+ goto out_unlock;
|
|
|
|
+ }
|
|
key.objectid = btrfs_ino(inode);
|
|
key.objectid = btrfs_ino(inode);
|
|
key.offset = 0;
|
|
key.offset = 0;
|
|
btrfs_set_key_type(&key, BTRFS_EXTENT_DATA_KEY);
|
|
btrfs_set_key_type(&key, BTRFS_EXTENT_DATA_KEY);
|