]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nfsd: separate nfsd_last_thread() from nfsd_put()
authorNeilBrown <neilb@suse.de>
Mon, 31 Jul 2023 06:48:32 +0000 (16:48 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jan 2024 14:18:37 +0000 (15:18 +0100)
commit03d68ffc48b94cc1e15bbf3b4f16f1e1e4fa286a
tree16848e1249caedb5de3d5d0c9abf82ba83a8347b
parent481561a431fff2e00b353fabe59cef7ba6d6f946
nfsd: separate nfsd_last_thread() from nfsd_put()

[ Upstream commit 9f28a971ee9fdf1bf8ce8c88b103f483be610277 ]

Now that the last nfsd thread is stopped by an explicit act of calling
svc_set_num_threads() with a count of zero, we only have a limited
number of places that can happen, and don't need to call
nfsd_last_thread() in nfsd_put()

So separate that out and call it at the two places where the number of
threads is set to zero.

Move the clearing of ->nfsd_serv and the call to svc_xprt_destroy_all()
into nfsd_last_thread(), as they are really part of the same action.

nfsd_put() is now a thin wrapper around svc_put(), so make it a static
inline.

nfsd_put() cannot be called after nfsd_last_thread(), so in a couple of
places we have to use svc_put() instead.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Stable-dep-of: 2a501f55cd64 ("nfsd: call nfsd_last_thread() before final nfsd_put()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfsd/nfsd.h
fs/nfsd/nfssvc.c