Linux NFS development
 help / color / mirror / Atom feed
* [PATCH] nfsd: don't use GFP_KERNEL from nfsd_getxattr()/nfsd_listxattr()
@ 2023-04-15 11:07 Tetsuo Handa
  2023-04-15 11:42 ` Jeff Layton
  2023-04-15 16:13 ` Chuck Lever III
  0 siblings, 2 replies; 17+ messages in thread
From: Tetsuo Handa @ 2023-04-15 11:07 UTC (permalink / raw)
  To: Chuck Lever, Jeff Layton, Frank van der Linden,
	open list:NFS, SUNRPC, AND...

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.

Fixes: 32119446bb65 ("nfsd: define xattr functions to call into their vfs counterparts")
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
---
 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;
-- 
2.34.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-04-20 15:20 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-15 11:07 [PATCH] nfsd: don't use GFP_KERNEL from nfsd_getxattr()/nfsd_listxattr() Tetsuo Handa
2023-04-15 11:42 ` Jeff Layton
2023-04-15 16:13 ` Chuck Lever III
2023-04-15 17:11   ` Tetsuo Handa
2023-04-15 18:40     ` Jeff Layton
2023-04-15 23:21       ` Tetsuo Handa
2023-04-16 11:51         ` Jeff Layton
2023-04-16 16:20           ` Chuck Lever III
2023-04-16 23:37           ` Dave Chinner
2023-04-17 22:25             ` Frank van der Linden
2023-04-17 23:07               ` Frank van der Linden
2023-04-19 13:51             ` Chuck Lever III
2023-04-19 23:32               ` Dave Chinner
2023-04-20 13:41                 ` Chuck Lever III
2023-04-20 14:05                   ` Tetsuo Handa
2023-04-20 14:41                     ` Chuck Lever III
2023-04-20 15:20             ` Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox