Thread (19 messages) 19 messages, 3 authors, 2023-04-14
STALE1160d

[PATCH 4/6] nfsd: don't take/put an extra reference when putting a file

From: Jeff Layton <jlayton@kernel.org>
Date: 2023-01-18 17:32:27
Subsystem: filesystems (vfs and infrastructure), kernel nfsd, sunrpc, and lockd servers, the rest · Maintainers: Alexander Viro, Christian Brauner, Chuck Lever, Jeff Layton, Linus Torvalds

The last thing that filp_close does is an fput, so don't bother taking
and putting the extra reference.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/nfsd/filecache.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
index a2bc4bd90b9a..f604dd8109e4 100644
--- a/fs/nfsd/filecache.c
+++ b/fs/nfsd/filecache.c
@@ -401,11 +401,8 @@ nfsd_file_free(struct nfsd_file *nf)
 
 	if (nf->nf_mark)
 		nfsd_file_mark_put(nf->nf_mark);
-	if (nf->nf_file) {
-		get_file(nf->nf_file);
+	if (nf->nf_file)
 		filp_close(nf->nf_file, NULL);
-		fput(nf->nf_file);
-	}
 
 	/*
 	 * If this item is still linked via nf_lru, that's a bug.
-- 
2.39.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help