]> www.infradead.org Git - users/dwmw2/linux.git/commit
nfsd: drop the nfsd_put helper
authorJeff Layton <jlayton@kernel.org>
Wed, 3 Jan 2024 13:36:52 +0000 (08:36 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:19:29 +0000 (16:19 +0200)
commit32c2cb2c0d37367c67d613bfa4407a0302e6102b
tree14cc3a5bb69ec1f4f0d356d8f18cb2865fb6b0f8
parentc52fee7a1f984f32ef2b18c1491effdf417492f7
nfsd: drop the nfsd_put helper

[ Upstream commit 64e6304169f1e1f078e7f0798033f80a7fb0ea46 ]

It's not safe to call nfsd_put once nfsd_last_thread has been called, as
that function will zero out the nn->nfsd_serv pointer.

Drop the nfsd_put helper altogether and open-code the svc_put in its
callers instead. That allows us to not be reliant on the value of that
pointer when handling an error.

Fixes: 2a501f55cd64 ("nfsd: call nfsd_last_thread() before final nfsd_put()")
Reported-by: Zhi Li <yieli@redhat.com>
Cc: NeilBrown <neilb@suse.de>
Signed-off-by: Jeffrey Layton <jlayton@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfsctl.c
fs/nfsd/nfsd.h