提交 8d2db785 编写于 作者: D David Sterba

btrfs: use GFP_KERNEL for allocations in ioctl handlers

We don't have to use GFP_NOFS in the ioctl handlers because there's no
risk of looping through the allocators back to the filesystem. This
patch covers only allocations that are directly in the ioctl handlers.
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 1ec21837
...@@ -4147,7 +4147,7 @@ static long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg) ...@@ -4147,7 +4147,7 @@ static long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
return -ENOMEM; return -ENOMEM;
space_args.total_spaces = 0; space_args.total_spaces = 0;
dest = kmalloc(alloc_size, GFP_NOFS); dest = kmalloc(alloc_size, GFP_KERNEL);
if (!dest) if (!dest)
return -ENOMEM; return -ENOMEM;
dest_orig = dest; dest_orig = dest;
...@@ -4673,7 +4673,7 @@ static long btrfs_ioctl_balance(struct file *file, void __user *arg) ...@@ -4673,7 +4673,7 @@ static long btrfs_ioctl_balance(struct file *file, void __user *arg)
goto out_bargs; goto out_bargs;
} }
bctl = kzalloc(sizeof(*bctl), GFP_NOFS); bctl = kzalloc(sizeof(*bctl), GFP_KERNEL);
if (!bctl) { if (!bctl) {
ret = -ENOMEM; ret = -ENOMEM;
goto out_bargs; goto out_bargs;
...@@ -4759,7 +4759,7 @@ static long btrfs_ioctl_balance_progress(struct btrfs_root *root, ...@@ -4759,7 +4759,7 @@ static long btrfs_ioctl_balance_progress(struct btrfs_root *root,
goto out; goto out;
} }
bargs = kzalloc(sizeof(*bargs), GFP_NOFS); bargs = kzalloc(sizeof(*bargs), GFP_KERNEL);
if (!bargs) { if (!bargs) {
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
...@@ -5019,7 +5019,7 @@ static long btrfs_ioctl_quota_rescan_status(struct file *file, void __user *arg) ...@@ -5019,7 +5019,7 @@ static long btrfs_ioctl_quota_rescan_status(struct file *file, void __user *arg)
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
qsa = kzalloc(sizeof(*qsa), GFP_NOFS); qsa = kzalloc(sizeof(*qsa), GFP_KERNEL);
if (!qsa) if (!qsa)
return -ENOMEM; return -ENOMEM;
...@@ -5149,7 +5149,7 @@ static long btrfs_ioctl_set_received_subvol_32(struct file *file, ...@@ -5149,7 +5149,7 @@ static long btrfs_ioctl_set_received_subvol_32(struct file *file,
goto out; goto out;
} }
args64 = kmalloc(sizeof(*args64), GFP_NOFS); args64 = kmalloc(sizeof(*args64), GFP_KERNEL);
if (!args64) { if (!args64) {
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册