summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs42xattr.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2022-01-29 14:03:06 -0500
committerTrond Myklebust <trond.myklebust@hammerspace.com>2022-02-25 18:50:12 -0500
commit5c60e89e71f864033a268ed66933dad0d92f1550 (patch)
tree8720cb1e6b84cea4e554447328f9baa95f1da8ac /fs/nfs/nfs42xattr.c
parent9c00fd9acba81070e9413a468df57cf89d6ee960 (diff)
downloadlinux-5c60e89e71f864033a268ed66933dad0d92f1550.tar.gz
linux-5c60e89e71f864033a268ed66933dad0d92f1550.tar.bz2
linux-5c60e89e71f864033a268ed66933dad0d92f1550.zip
NFSv4.2: Fix up an invalid combination of memory allocation flags
We should use either GFP_KERNEL or GFP_NOFS, but not both. Also strip GFP_KERNEL_ACCOUNT down to GFP_KERNEL. This memory is shrinkable, so does not need to be limited by kmemcg. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/nfs42xattr.c')
-rw-r--r--fs/nfs/nfs42xattr.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/nfs/nfs42xattr.c b/fs/nfs/nfs42xattr.c
index 1c4d2a05b401..ad3405c64b9e 100644
--- a/fs/nfs/nfs42xattr.c
+++ b/fs/nfs/nfs42xattr.c
@@ -199,7 +199,7 @@ nfs4_xattr_alloc_entry(const char *name, const void *value,
flags = NFS4_XATTR_ENTRY_EXTVAL;
}
- buf = kmalloc(alloclen, GFP_KERNEL_ACCOUNT | GFP_NOFS);
+ buf = kmalloc(alloclen, GFP_KERNEL);
if (buf == NULL)
return NULL;
entry = (struct nfs4_xattr_entry *)buf;
@@ -213,7 +213,7 @@ nfs4_xattr_alloc_entry(const char *name, const void *value,
if (flags & NFS4_XATTR_ENTRY_EXTVAL) {
- valp = kvmalloc(len, GFP_KERNEL_ACCOUNT | GFP_NOFS);
+ valp = kvmalloc(len, GFP_KERNEL);
if (valp == NULL) {
kfree(buf);
return NULL;
@@ -289,8 +289,7 @@ nfs4_xattr_alloc_cache(void)
{
struct nfs4_xattr_cache *cache;
- cache = kmem_cache_alloc(nfs4_xattr_cache_cachep,
- GFP_KERNEL_ACCOUNT | GFP_NOFS);
+ cache = kmem_cache_alloc(nfs4_xattr_cache_cachep, GFP_KERNEL);
if (cache == NULL)
return NULL;