From: Wang Yugui <wangyugui@e16-tech.com>
To: Jeff Layton <jlayton@kernel.org>
Cc: linux-nfs@vger.kernel.org, Chuck Lever <chuck.lever@oracle.com>
Subject: Re: a nfsd_file_free panic when shudown
Date: Thu, 22 Dec 2022 21:06:13 +0800 [thread overview]
Message-ID: <20221222210612.729F.409509F4@e16-tech.com> (raw)
In-Reply-To: <4e218538a081da09ab82b18cf7185602b62c18d7.camel@kernel.org>
Hi,
> On Thu, 2022-12-22 at 17:38 +0800, Wang Yugui wrote:
> > Hi, Jeff Layton
> >
> > > Hi,
> > > > a nfsd_file_free panic when shudown.
> > > >
> > > > This is a kernel 6.1.1 with some nfsd 6.2 pathes.
> > > > It happened when os shutdown.
> > > >
> > > > but the reproducer is yet not clear.
> > > > we just gather the info of the attachment file.
> > >
> > > Now I can reproduce it.
> > > 1) 'tail -f xxx' to keep a file is open from nfs4 client
> > > 2) 'shutdow -r now' the nfs server.
> > >
> > > more panic info in the attachment files (panic-2.txt/panic-3.txt)
> > >
> > > >
> > > > It happened just after 'Subject: nfsd: rework refcounting in filecache'
> > > > is added, so this patch maybe related.
> >
> > It is confirmed that this panic is caused by the patch
> > 'nfsd: rework refcounting in filecache'.
> >
> > the problem is 100% reproduced when this patch is applied.
> > the problem is yet not reproduced when this patch is not applied.
> >
> > Best Regards
> > Wang Yugui (wangyugui@e16-tech.com)
> > 2022/12/22
> >
>
> Thanks for the bug report! This patch seems to fix the problem for me.
> Can you test it and let me know whether it also fixes it for you? If so,
> I'll send this to Chuck and the list for inclusion soon.
This new patch fix the problem here too. Thanks a lot.
Best Regards
Wang Yugui (wangyugui@e16-tech.com)
2022/12/22
>
> Thanks!
> --?
> Jeff Layton <jlayton@kernel.org>
>
> --------------------8<--------------------------
>
> [PATCH] nfsd: shut down the NFSv4 state objects before the filecache
>
> Currently, we shut down the filecache before trying to clean up the
> stateids that depend on it, which can lead to an oops at shutdown time
> due to a refcount imbalance. Change the shutdown procedures to bring
> down the state handling infrastructure prior to shutting down the
> filecache.
>
> Reported-by: Wang Yugui <wangyugui@e16-tech.com>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
> fs/nfsd/nfssvc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
> index 56fba1cba3af..325d3d3f1211 100644
> --- a/fs/nfsd/nfssvc.c
> +++ b/fs/nfsd/nfssvc.c
> @@ -453,8 +453,8 @@ static void nfsd_shutdown_net(struct net *net)
> {
> struct nfsd_net *nn = net_generic(net, nfsd_net_id);
>
> - nfsd_file_cache_shutdown_net(net);
> nfs4_state_shutdown_net(net);
> + nfsd_file_cache_shutdown_net(net);
> if (nn->lockd_up) {
> lockd_down(net);
> nn->lockd_up = false;
> --
> 2.38.1
>
prev parent reply other threads:[~2022-12-22 13:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-22 6:15 a nfsd_file_free panic when shudown Wang Yugui
2022-12-22 8:15 ` Wang Yugui
2022-12-22 9:38 ` Wang Yugui
2022-12-22 11:18 ` Jeff Layton
2022-12-22 13:06 ` Wang Yugui [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=20221222210612.729F.409509F4@e16-tech.com \
--to=wangyugui@e16-tech.com \
--cc=chuck.lever@oracle.com \
--cc=jlayton@kernel.org \
--cc=linux-nfs@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