Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Chuck Lever III <chuck.lever@oracle.com>
Cc: Chuck Lever <cel@kernel.org>,
	linux-stable <stable@vger.kernel.org>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
	Li Lingfeng <lilingfeng3@huawei.com>, Neil Brown <neilb@suse.de>,
	Jeff Layton <jlayton@kernel.org>
Subject: Re: [PATCH 6.6.y] NFSD: simplify error paths in nfsd_svc()
Date: Tue, 27 Aug 2024 16:40:54 +0200	[thread overview]
Message-ID: <2024082749-goldfish-handwoven-09b3@gregkh> (raw)
In-Reply-To: <3C709C8F-8708-4434-8E64-41931DC5C753@oracle.com>

On Tue, Aug 27, 2024 at 02:25:03PM +0000, Chuck Lever III wrote:
> 
> 
> > On Aug 27, 2024, at 8:46 AM, Greg KH <greg@kroah.com> wrote:
> > 
> > On Sat, Aug 24, 2024 at 12:21:37PM -0400, cel@kernel.org wrote:
> >> From: NeilBrown <neilb@suse.de>
> >> 
> >> [ Upstream commit bf32075256e9dd9c6b736859e2c5813981339908 ]
> >> 
> >> The error paths in nfsd_svc() are needlessly complex and can result in a
> >> final call to svc_put() without nfsd_last_thread() being called.  This
> >> results in the listening sockets not being closed properly.
> >> 
> >> The per-netns setup provided by nfsd_startup_new() and removed by
> >> nfsd_shutdown_net() is needed precisely when there are running threads.
> >> So we don't need nfsd_up_before.  We don't need to know if it *was* up.
> >> We only need to know if any threads are left.  If none are, then we must
> >> call nfsd_shutdown_net().  But we don't need to do that explicitly as
> >> nfsd_last_thread() does that for us.
> >> 
> >> So simply call nfsd_last_thread() before the last svc_put() if there are
> >> no running threads.  That will always do the right thing.
> >> 
> >> Also discard:
> >> pr_info("nfsd: last server has exited, flushing export cache\n");
> >> It may not be true if an attempt to start the first server failed, and
> >> it isn't particularly helpful and it simply reports normal behaviour.
> >> 
> >> Signed-off-by: NeilBrown <neilb@suse.de>
> >> Reviewed-by: Jeff Layton <jlayton@kernel.org>
> >> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> >> ---
> >> fs/nfsd/nfssvc.c | 14 ++++----------
> >> 1 file changed, 4 insertions(+), 10 deletions(-)
> >> 
> >> Reported-by: Li Lingfeng <lilingfeng3@huawei.com>
> >> Suggested-by: Li Lingfeng <lilingfeng3@huawei.com>
> >> Tested-by: Li Lingfeng <lilingfeng3@huawei.com>
> > 
> > Odd placement of these :)
> 
> Wasn't sure I was supposed to add them to the actual
> patch description because they weren't part of the
> original upstream commit.
> 
> But if that's OK to do for stable patches, I will
> add them in the usual spot next time.

Yes please, thanks!

      reply	other threads:[~2024-08-27 15:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-24 16:21 [PATCH 6.6.y] NFSD: simplify error paths in nfsd_svc() cel
2024-08-27 12:46 ` Greg KH
2024-08-27 14:25   ` Chuck Lever III
2024-08-27 14:40     ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2024082749-goldfish-handwoven-09b3@gregkh \
    --to=greg@kroah.com \
    --cc=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=lilingfeng3@huawei.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox