nfsd4: fix v4 state shutdown error paths
authorJeff Layton <jlayton@redhat.com>
Mon, 19 Jul 2010 20:50:04 +0000 (16:50 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 23 Jul 2010 12:51:22 +0000 (08:51 -0400)
commit4ad9a344be2291b1e594a4a5aee25c5a5df34a97
treef2e8780a1461194231fbb124cffc964517424c1e
parent55b13354d789dcf0b85db6d86fc3a9e57dca02c1
nfsd4: fix v4 state shutdown error paths

If someone tries to shut down the laundry_wq while it isn't up it'll
cause an oops.

This can happen because write_ports can create a nfsd_svc before we
really start the nfs server, and we may fail before the server is ever
started.

Also make sure state is shutdown on error paths in nfsd_svc().

Use a common global nfsd_up flag instead of nfs4_init, and create common
helper functions for nfsd start/shutdown, as there will be other work
that we want done only when we the number of nfsd threads transitions
between zero and nonzero.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c
fs/nfsd/nfssvc.c