]> git.baikalelectronics.ru Git - kernel.git/commit
NFSD: Add an NFSD_FILE_GC flag to enable nfsd_file garbage collection
authorChuck Lever <chuck.lever@oracle.com>
Fri, 28 Oct 2022 14:46:51 +0000 (10:46 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:58:25 +0000 (11:58 +0100)
commitacb0f2a5102b3947f27f5725867860f51a908b2a
treeef051fbe8c466c51b208fecb6998473631d0714f
parentf2db1a9fb0f3893d207811eba5b7e38edaadcb50
NFSD: Add an NFSD_FILE_GC flag to enable nfsd_file garbage collection

[ Upstream commit cfc60ed966c033daa62ad988c60eb30b574e27d0 ]

NFSv4 operations manage the lifetime of nfsd_file items they use by
means of NFSv4 OPEN and CLOSE. Hence there's no need for them to be
garbage collected.

Introduce a mechanism to enable garbage collection for nfsd_file
items used only by NFSv2/3 callers.

Note that the change in nfsd_file_put() ensures that both CLOSE and
DELEGRETURN will actually close out and free an nfsd_file on last
reference of a non-garbage-collected file.

Link: https://bugzilla.linux-nfs.org/show_bug.cgi?id=394
Suggested-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Tested-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: NeilBrown <neilb@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Stable-dep-of: 581a77c94d4e ("nfsd: fix handling of cached open files in nfsd4_open codepath")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfsd/filecache.c
fs/nfsd/filecache.h
fs/nfsd/nfs3proc.c
fs/nfsd/trace.h
fs/nfsd/vfs.c