Skip to content

Commit 39a27ec

Browse files
committed
btrfs: use GFP_KERNEL for xattr and acl allocations
We don't have to use GFP_NOFS in context of ACL or XATTR actions, not possible to loop through the allocator and it's safe to fail with ENOMEM. Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 61dd5ae commit 39a27ec

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎fs/btrfs/acl.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
4848

4949
size = __btrfs_getxattr(inode, name, "", 0);
5050
if (size > 0) {
51-
value = kzalloc(size, GFP_NOFS);
51+
value = kzalloc(size, GFP_KERNEL);
5252
if (!value)
5353
return ERR_PTR(-ENOMEM);
5454
size = __btrfs_getxattr(inode, name, value, size);
@@ -102,7 +102,7 @@ static int __btrfs_set_acl(struct btrfs_trans_handle *trans,
102102

103103
if (acl) {
104104
size = posix_acl_xattr_size(acl->a_count);
105-
value = kmalloc(size, GFP_NOFS);
105+
value = kmalloc(size, GFP_KERNEL);
106106
if (!value) {
107107
ret = -ENOMEM;
108108
goto out;

‎fs/btrfs/xattr.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ static int btrfs_initxattrs(struct inode *inode,
494494

495495
for (xattr = xattr_array; xattr->name != NULL; xattr++) {
496496
name = kmalloc(XATTR_SECURITY_PREFIX_LEN +
497-
strlen(xattr->name) + 1, GFP_NOFS);
497+
strlen(xattr->name) + 1, GFP_KERNEL);
498498
if (!name) {
499499
err = -ENOMEM;
500500
break;

0 commit comments

Comments
 (0)