Skip to content

Commit 8d2db78

Browse files
committed
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: David Sterba <dsterba@suse.com>
1 parent 1ec2183 commit 8d2db78

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎fs/btrfs/ioctl.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4147,7 +4147,7 @@ static long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
41474147
return -ENOMEM;
41484148

41494149
space_args.total_spaces = 0;
4150-
dest = kmalloc(alloc_size, GFP_NOFS);
4150+
dest = kmalloc(alloc_size, GFP_KERNEL);
41514151
if (!dest)
41524152
return -ENOMEM;
41534153
dest_orig = dest;
@@ -4673,7 +4673,7 @@ static long btrfs_ioctl_balance(struct file *file, void __user *arg)
46734673
goto out_bargs;
46744674
}
46754675

4676-
bctl = kzalloc(sizeof(*bctl), GFP_NOFS);
4676+
bctl = kzalloc(sizeof(*bctl), GFP_KERNEL);
46774677
if (!bctl) {
46784678
ret = -ENOMEM;
46794679
goto out_bargs;
@@ -4759,7 +4759,7 @@ static long btrfs_ioctl_balance_progress(struct btrfs_root *root,
47594759
goto out;
47604760
}
47614761

4762-
bargs = kzalloc(sizeof(*bargs), GFP_NOFS);
4762+
bargs = kzalloc(sizeof(*bargs), GFP_KERNEL);
47634763
if (!bargs) {
47644764
ret = -ENOMEM;
47654765
goto out;
@@ -5019,7 +5019,7 @@ static long btrfs_ioctl_quota_rescan_status(struct file *file, void __user *arg)
50195019
if (!capable(CAP_SYS_ADMIN))
50205020
return -EPERM;
50215021

5022-
qsa = kzalloc(sizeof(*qsa), GFP_NOFS);
5022+
qsa = kzalloc(sizeof(*qsa), GFP_KERNEL);
50235023
if (!qsa)
50245024
return -ENOMEM;
50255025

@@ -5149,7 +5149,7 @@ static long btrfs_ioctl_set_received_subvol_32(struct file *file,
51495149
goto out;
51505150
}
51515151

5152-
args64 = kmalloc(sizeof(*args64), GFP_NOFS);
5152+
args64 = kmalloc(sizeof(*args64), GFP_KERNEL);
51535153
if (!args64) {
51545154
ret = -ENOMEM;
51555155
goto out;

0 commit comments

Comments
 (0)