Message ID | 20200327232717.15331-10-fllinden@amazon.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | NFS server user xattr support (RFC8276) | expand |
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 6e7fc6a9931e..f6322add2992 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -230,7 +230,7 @@ svcxdr_tmpalloc(struct nfsd4_compoundargs *argp, u32 len) { struct svcxdr_tmpbuf *tb; - tb = kmalloc(sizeof(*tb) + len, GFP_KERNEL); + tb = kvmalloc(sizeof(*tb) + len, GFP_KERNEL); if (!tb) return NULL; tb->next = argp->to_free; @@ -4691,7 +4691,7 @@ void nfsd4_release_compoundargs(struct svc_rqst *rqstp) while (args->to_free) { struct svcxdr_tmpbuf *tb = args->to_free; args->to_free = tb->next; - kfree(tb); + kvfree(tb); } }
For user extended attributes, temp allocations larger than one page might be needed. Use kvmalloc/kvfree to accommodate these larger allocations, while not affecting the performance of the smaller ones. Signed-off-by: Frank van der Linden <fllinden@amazon.com> --- fs/nfsd/nfs4xdr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)