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

J. Bruce Fields
2010-06-08T23:58:29Z

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.

OK, thanks.

Hm: what about the opposite (admittedly probably less crucial) problem:
are there cases where nfs4_state_start() gets called but never
nfs4_state_shutdown?

>From a quick look, I don't see what prevents that.

--b.

>
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
> ---
> fs/nfsd/nfs4state.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index 1176708..fc52920 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -4124,6 +4124,8 @@ __nfs4_state_shutdown(void)
> void
> nfs4_state_shutdown(void)
> {
> + if (!nfs4_init)
> + return;
> cancel_rearming_delayed_workqueue(laundry_wq, &laundromat_work);
> destroy_workqueue(laundry_wq);
> locks_end_grace(&nfsd4_manager);
> --
> 1.5.5.6
>