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>
Mon, 15 Jan 2024 17:57:06 +0000 (18:57 +0100)
commitedbc5613957936dd6ca54a74e129ce9aa7442f82
tree9afe6a1eb12bcac04f53422a6d12e6169a4bb4e9
parent22852eaf43ec64b7dc0aa72687b22237b65a88f9
nfsd: drop the nfsd_put helper

commit 64e6304169f1e1f078e7f0798033f80a7fb0ea46 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/nfsctl.c
fs/nfsd/nfsd.h