This is a note to let you know that I've just added the patch titled Revert "nfsd: call nfsd_last_thread() before final nfsd_put()" to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: revert-nfsd-call-nfsd_last_thread-before-final-nfsd_put.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 32e8507831dec1ffdd2af80b87f80d04adb6cbe7 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Date: Sat, 13 Jan 2024 10:37:06 +0100 Subject: Revert "nfsd: call nfsd_last_thread() before final nfsd_put()" From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> This reverts commit bb4f791cb2de1140d0fbcedfe9e791ff364021d7 which is commit 2a501f55cd641eb4d3c16a2eab0d678693fac663 upstream. It is reported to cause issues, so revert it. Reported-by: email200202 <email200202@xxxxxxxxx> Link: https://lore.kernel.org/r/e341cb408b5663d8c91b8fa57b41bb984be43448.camel@xxxxxxxxxx Cc: NeilBrown <neilb@xxxxxxx> Cc: Jeff Layton <jlayton@xxxxxxxxxx> Cc: Chuck Lever <chuck.lever@xxxxxxxxxx> Cc: Sasha Levin <sashal@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/nfsd/nfsctl.c | 9 ++------- fs/nfsd/nfsd.h | 1 - fs/nfsd/nfssvc.c | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c @@ -716,10 +716,8 @@ static ssize_t __write_ports_addfd(char err = svc_addsock(nn->nfsd_serv, net, fd, buf, SIMPLE_TRANSACTION_LIMIT, cred); - if (err < 0 && !nn->nfsd_serv->sv_nrthreads && !nn->keep_active) - nfsd_last_thread(net); - else if (err >= 0 && - !nn->nfsd_serv->sv_nrthreads && !xchg(&nn->keep_active, 1)) + if (err >= 0 && + !nn->nfsd_serv->sv_nrthreads && !xchg(&nn->keep_active, 1)) svc_get(nn->nfsd_serv); nfsd_put(net); @@ -769,9 +767,6 @@ out_close: svc_xprt_put(xprt); } out_err: - if (!nn->nfsd_serv->sv_nrthreads && !nn->keep_active) - nfsd_last_thread(net); - nfsd_put(net); return err; } --- a/fs/nfsd/nfsd.h +++ b/fs/nfsd/nfsd.h @@ -139,7 +139,6 @@ int nfsd_vers(struct nfsd_net *nn, int v int nfsd_minorversion(struct nfsd_net *nn, u32 minorversion, enum vers_op change); void nfsd_reset_versions(struct nfsd_net *nn); int nfsd_create_serv(struct net *net); -void nfsd_last_thread(struct net *net); extern int nfsd_max_blksize; --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c @@ -523,7 +523,7 @@ static struct notifier_block nfsd_inet6a /* Only used under nfsd_mutex, so this atomic may be overkill: */ static atomic_t nfsd_notifier_refcount = ATOMIC_INIT(0); -void nfsd_last_thread(struct net *net) +static void nfsd_last_thread(struct net *net) { struct nfsd_net *nn = net_generic(net, nfsd_net_id); struct svc_serv *serv = nn->nfsd_serv; Patches currently in stable-queue which might be from gregkh@xxxxxxxxxxxxxxxxxxx are queue-6.1/revert-nfsd-separate-nfsd_last_thread-from-nfsd_put.patch queue-6.1/ipv6-remove-max_size-check-inline-with-ipv4.patch queue-6.1/revert-nfsd-call-nfsd_last_thread-before-final-nfsd_put.patch queue-6.1/cifs-fix-flushing-folio-regression-for-6.1-backport.patch