Re: [PATCH 1/3] nfsd: don't try to shut down nfs4 state handling unless it's up

Jeff Layton
2010-06-27T01:06:34Z

On Sat, 26 Jun 2010 11:53:51 -0400
"J. Bruce Fields" <bfields@fieldses.org> wrote:

> On Mon, Jun 07, 2010 at 11:33:18AM -0400, Jeff Layton wrote:
> > If someone tries to shut down the laundry_wq while it isn't up it'll
> > cause an oops.
>
> Sorry for getting behind....
>

No huge hurry. This series is pretty much 2.6.36 material unless you
see a reason to push them sooner.

> I'm not seeing how this can happen: nfs4_state_shutdown() is called from
> nfsd_last_thread(), which can't be called until after nfsd_create_serv()
> is called. But nfsd_create_serv() is called after nfs4_state_start().
>
> Oh, I see, I'm overlooking __write_ports_add{fd,xprt}(), which can call
> nfsd_create_serv() without first calling nfs4_state_start(). Argh.
>

Yep...and rpc.nfsd does write fd's to the kernel before bringing up
threads, so this situation is actually the norm. The later patches in
this series also mandate this to prevent oopses when there are errors
bringing up the service.

--
Jeff Layton <jlayton@redhat.com>