Loading fs/btrfs/ctree.c +8 −4 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <linux/sched.h> #include <linux/slab.h> #include <linux/rbtree.h> #include <linux/vmalloc.h> #include "ctree.h" #include "disk-io.h" #include "transaction.h" Loading Loading @@ -5361,11 +5362,14 @@ int btrfs_compare_trees(struct btrfs_root *left_root, goto out; } tmp_buf = kmalloc(left_root->nodesize, GFP_KERNEL); tmp_buf = kmalloc(left_root->nodesize, GFP_KERNEL | __GFP_NOWARN); if (!tmp_buf) { tmp_buf = vmalloc(left_root->nodesize); if (!tmp_buf) { ret = -ENOMEM; goto out; } } left_path->search_commit_root = 1; left_path->skip_locking = 1; Loading Loading @@ -5565,7 +5569,7 @@ int btrfs_compare_trees(struct btrfs_root *left_root, out: btrfs_free_path(left_path); btrfs_free_path(right_path); kfree(tmp_buf); kvfree(tmp_buf); return ret; } Loading fs/btrfs/dev-replace.c +2 −0 Original line number Diff line number Diff line Loading @@ -394,6 +394,8 @@ int btrfs_dev_replace_start(struct btrfs_root *root, dev_replace->cursor_right = 0; dev_replace->is_valid = 1; dev_replace->item_needs_writeback = 1; atomic64_set(&dev_replace->num_write_errors, 0); atomic64_set(&dev_replace->num_uncorrectable_read_errors, 0); args->result = BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR; btrfs_dev_replace_unlock(dev_replace, 1); Loading fs/btrfs/extent-tree.c +19 −2 Original line number Diff line number Diff line Loading @@ -9386,15 +9386,23 @@ int btrfs_can_relocate(struct btrfs_root *root, u64 bytenr) u64 dev_min = 1; u64 dev_nr = 0; u64 target; int debug; int index; int full = 0; int ret = 0; debug = btrfs_test_opt(root, ENOSPC_DEBUG); block_group = btrfs_lookup_block_group(root->fs_info, bytenr); /* odd, couldn't find the block group, leave it alone */ if (!block_group) if (!block_group) { if (debug) btrfs_warn(root->fs_info, "can't find block group for bytenr %llu", bytenr); return -1; } min_free = btrfs_block_group_used(&block_group->item); Loading Loading @@ -9448,8 +9456,13 @@ int btrfs_can_relocate(struct btrfs_root *root, u64 bytenr) * this is just a balance, so if we were marked as full * we know there is no space for a new chunk */ if (full) if (full) { if (debug) btrfs_warn(root->fs_info, "no space to alloc new chunk for block group %llu", block_group->key.objectid); goto out; } index = get_block_group_index(block_group); } Loading Loading @@ -9496,6 +9509,10 @@ int btrfs_can_relocate(struct btrfs_root *root, u64 bytenr) ret = -1; } } if (debug && ret == -1) btrfs_warn(root->fs_info, "no space to allocate a new chunk for block group %llu", block_group->key.objectid); mutex_unlock(&root->fs_info->chunk_mutex); btrfs_end_transaction(trans, root); out: Loading fs/btrfs/file.c +6 −3 Original line number Diff line number Diff line Loading @@ -2682,9 +2682,12 @@ static long btrfs_fallocate(struct file *file, int mode, return ret; inode_lock(inode); ret = inode_newsize_ok(inode, alloc_end); if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + len > inode->i_size) { ret = inode_newsize_ok(inode, offset + len); if (ret) goto out; } /* * TODO: Move these two operations after we have checked Loading fs/btrfs/ioctl.c +1 −1 Original line number Diff line number Diff line Loading @@ -1654,7 +1654,7 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file, src_inode = file_inode(src.file); if (src_inode->i_sb != file_inode(file)->i_sb) { btrfs_info(BTRFS_I(src_inode)->root->fs_info, btrfs_info(BTRFS_I(file_inode(file))->root->fs_info, "Snapshot src from another FS"); ret = -EXDEV; } else if (!inode_owner_or_capable(src_inode)) { Loading Loading
fs/btrfs/ctree.c +8 −4 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <linux/sched.h> #include <linux/slab.h> #include <linux/rbtree.h> #include <linux/vmalloc.h> #include "ctree.h" #include "disk-io.h" #include "transaction.h" Loading Loading @@ -5361,11 +5362,14 @@ int btrfs_compare_trees(struct btrfs_root *left_root, goto out; } tmp_buf = kmalloc(left_root->nodesize, GFP_KERNEL); tmp_buf = kmalloc(left_root->nodesize, GFP_KERNEL | __GFP_NOWARN); if (!tmp_buf) { tmp_buf = vmalloc(left_root->nodesize); if (!tmp_buf) { ret = -ENOMEM; goto out; } } left_path->search_commit_root = 1; left_path->skip_locking = 1; Loading Loading @@ -5565,7 +5569,7 @@ int btrfs_compare_trees(struct btrfs_root *left_root, out: btrfs_free_path(left_path); btrfs_free_path(right_path); kfree(tmp_buf); kvfree(tmp_buf); return ret; } Loading
fs/btrfs/dev-replace.c +2 −0 Original line number Diff line number Diff line Loading @@ -394,6 +394,8 @@ int btrfs_dev_replace_start(struct btrfs_root *root, dev_replace->cursor_right = 0; dev_replace->is_valid = 1; dev_replace->item_needs_writeback = 1; atomic64_set(&dev_replace->num_write_errors, 0); atomic64_set(&dev_replace->num_uncorrectable_read_errors, 0); args->result = BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR; btrfs_dev_replace_unlock(dev_replace, 1); Loading
fs/btrfs/extent-tree.c +19 −2 Original line number Diff line number Diff line Loading @@ -9386,15 +9386,23 @@ int btrfs_can_relocate(struct btrfs_root *root, u64 bytenr) u64 dev_min = 1; u64 dev_nr = 0; u64 target; int debug; int index; int full = 0; int ret = 0; debug = btrfs_test_opt(root, ENOSPC_DEBUG); block_group = btrfs_lookup_block_group(root->fs_info, bytenr); /* odd, couldn't find the block group, leave it alone */ if (!block_group) if (!block_group) { if (debug) btrfs_warn(root->fs_info, "can't find block group for bytenr %llu", bytenr); return -1; } min_free = btrfs_block_group_used(&block_group->item); Loading Loading @@ -9448,8 +9456,13 @@ int btrfs_can_relocate(struct btrfs_root *root, u64 bytenr) * this is just a balance, so if we were marked as full * we know there is no space for a new chunk */ if (full) if (full) { if (debug) btrfs_warn(root->fs_info, "no space to alloc new chunk for block group %llu", block_group->key.objectid); goto out; } index = get_block_group_index(block_group); } Loading Loading @@ -9496,6 +9509,10 @@ int btrfs_can_relocate(struct btrfs_root *root, u64 bytenr) ret = -1; } } if (debug && ret == -1) btrfs_warn(root->fs_info, "no space to allocate a new chunk for block group %llu", block_group->key.objectid); mutex_unlock(&root->fs_info->chunk_mutex); btrfs_end_transaction(trans, root); out: Loading
fs/btrfs/file.c +6 −3 Original line number Diff line number Diff line Loading @@ -2682,9 +2682,12 @@ static long btrfs_fallocate(struct file *file, int mode, return ret; inode_lock(inode); ret = inode_newsize_ok(inode, alloc_end); if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + len > inode->i_size) { ret = inode_newsize_ok(inode, offset + len); if (ret) goto out; } /* * TODO: Move these two operations after we have checked Loading
fs/btrfs/ioctl.c +1 −1 Original line number Diff line number Diff line Loading @@ -1654,7 +1654,7 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file, src_inode = file_inode(src.file); if (src_inode->i_sb != file_inode(file)->i_sb) { btrfs_info(BTRFS_I(src_inode)->root->fs_info, btrfs_info(BTRFS_I(file_inode(file))->root->fs_info, "Snapshot src from another FS"); ret = -EXDEV; } else if (!inode_owner_or_capable(src_inode)) { Loading