Re: [PATCH] nfsd: don't use GFP_KERNEL from nfsd_getxattr()/nfsd_listxattr()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> On Apr 15, 2023, at 7:07 AM, Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx> wrote:
> 
> Since GFP_KERNEL is GFP_NOFS | __GFP_FS, usage like GFP_KERNEL | GFP_NOFS
> does not make sense. Drop __GFP_FS flag in order to avoid deadlock.

The server side threads run in process context. GFP_KERNEL
is safe to use here -- as Jeff said, this code is not in
the server's reclaim path. Plenty of other call sites in
the NFS server code use GFP_KERNEL.

But I agree that the flag combination doesn't make sense.
Maybe drop GFP_NOFS instead and call it only a clean-up?


> Fixes: 32119446bb65 ("nfsd: define xattr functions to call into their vfs counterparts")
> Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
> ---
> fs/nfsd/vfs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
> index 5783209f17fc..109b31246666 100644
> --- a/fs/nfsd/vfs.c
> +++ b/fs/nfsd/vfs.c
> @@ -2164,7 +2164,7 @@ nfsd_getxattr(struct svc_rqst *rqstp, struct svc_fh *fhp, char *name,
> goto out;
> }
> 
> - buf = kvmalloc(len, GFP_KERNEL | GFP_NOFS);
> + buf = kvmalloc(len, GFP_NOFS);
> if (buf == NULL) {
> err = nfserr_jukebox;
> goto out;
> @@ -2230,7 +2230,7 @@ nfsd_listxattr(struct svc_rqst *rqstp, struct svc_fh *fhp, char **bufp,
> /*
> * We're holding i_rwsem - use GFP_NOFS.
> */
> - buf = kvmalloc(len, GFP_KERNEL | GFP_NOFS);
> + buf = kvmalloc(len, GFP_NOFS);
> if (buf == NULL) {
> err = nfserr_jukebox;
> goto out;


--
Chuck Lever






[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux