diff options
author | David Sterba <dsterba@suse.com> | 2015-12-03 06:49:48 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2015-12-03 09:03:44 -0500 |
commit | 39a27ec1004e886f1d949bdb8f2616896d02c5c2 (patch) | |
tree | 1e4c4389f0857ca5bd38278cde2f68752269c8d9 | |
parent | 61dd5ae65be6dfaeadb0e841ea6639351f0e04ce (diff) |
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>
-rw-r--r-- | fs/btrfs/acl.c | 4 | ||||
-rw-r--r-- | fs/btrfs/xattr.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index 9a0124a95851..dbbb8ed53a51 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c | |||
@@ -48,7 +48,7 @@ struct posix_acl *btrfs_get_acl(struct inode *inode, int type) | |||
48 | 48 | ||
49 | size = __btrfs_getxattr(inode, name, "", 0); | 49 | size = __btrfs_getxattr(inode, name, "", 0); |
50 | if (size > 0) { | 50 | if (size > 0) { |
51 | value = kzalloc(size, GFP_NOFS); | 51 | value = kzalloc(size, GFP_KERNEL); |
52 | if (!value) | 52 | if (!value) |
53 | return ERR_PTR(-ENOMEM); | 53 | return ERR_PTR(-ENOMEM); |
54 | size = __btrfs_getxattr(inode, name, value, size); | 54 | size = __btrfs_getxattr(inode, name, value, size); |
@@ -102,7 +102,7 @@ static int __btrfs_set_acl(struct btrfs_trans_handle *trans, | |||
102 | 102 | ||
103 | if (acl) { | 103 | if (acl) { |
104 | size = posix_acl_xattr_size(acl->a_count); | 104 | size = posix_acl_xattr_size(acl->a_count); |
105 | value = kmalloc(size, GFP_NOFS); | 105 | value = kmalloc(size, GFP_KERNEL); |
106 | if (!value) { | 106 | if (!value) { |
107 | ret = -ENOMEM; | 107 | ret = -ENOMEM; |
108 | goto out; | 108 | goto out; |
diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c index 1fcd7b6e7564..24e8ff722730 100644 --- a/fs/btrfs/xattr.c +++ b/fs/btrfs/xattr.c | |||
@@ -494,7 +494,7 @@ static int btrfs_initxattrs(struct inode *inode, | |||
494 | 494 | ||
495 | for (xattr = xattr_array; xattr->name != NULL; xattr++) { | 495 | for (xattr = xattr_array; xattr->name != NULL; xattr++) { |
496 | name = kmalloc(XATTR_SECURITY_PREFIX_LEN + | 496 | name = kmalloc(XATTR_SECURITY_PREFIX_LEN + |
497 | strlen(xattr->name) + 1, GFP_NOFS); | 497 | strlen(xattr->name) + 1, GFP_KERNEL); |
498 | if (!name) { | 498 | if (!name) { |
499 | err = -ENOMEM; | 499 | err = -ENOMEM; |
500 | break; | 500 | break; |