nfsd: call nfsd_last_thread() before final nfsd_put()
JIRA: https://issues.redhat.com/browse/RHEL-19081
Late breaking fix that went upstream a couple of weeks ago:
commit 2a501f55cd641eb4d3c16a2eab0d678693fac663
Author: NeilBrown <neilb@suse.de>
Date: Fri Dec 15 11:56:31 2023 +1100
nfsd: call nfsd_last_thread() before final nfsd_put()
If write_ports_addfd or write_ports_addxprt fail, they call nfsd_put()
without calling nfsd_last_thread(). This leaves nn->nfsd_serv pointing
to a structure that has been freed.
So remove 'static' from nfsd_last_thread() and call it when the
nfsd_serv is about to be destroyed.
Fixes: ec52361df99b ("SUNRPC: stop using ->sv_nrthreads as a refcount")
Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Jeffrey Layton jlayton@redhat.com
Edited by Jeffrey Layton