struct nfsd_net *nn = net_generic(net, nfsd_net_id);
int err;
- /* Lock module and set up kernel thread */
- mutex_lock(&nfsd_mutex);
-
/* At this point, the thread shares current->fs
* with the init process. We need to create files with the
* umask as defined by the client instead of init's umask. */
allow_signal(SIGINT);
allow_signal(SIGQUIT);
- mutex_unlock(&nfsd_mutex);
atomic_inc(&nfsdstats.th_cnt);
set_freezable();
flush_signals(current);
atomic_dec(&nfsdstats.th_cnt);
- mutex_lock(&nfsd_mutex);
out:
/* Take an extra ref so that the svc_put in svc_exit_thread()
svc_exit_thread(rqstp);
/* Now if needed we call svc_destroy in appropriate context */
+ mutex_lock(&nfsd_mutex);
nfsd_put(net);
+ mutex_unlock(&nfsd_mutex);
/* Release module */
- mutex_unlock(&nfsd_mutex);
module_put_and_exit(0);
return 0;
}