Lockd: pass network namespace to creation and destruction routines

v2: dereference of most probably already released nlm_host removed in
nlmclnt_done() and reclaimer().

These routines are called from locks reclaimer() kernel thread. This thread
works in "init_net" network context and currently relays on persence on lockd
thread and it's per-net resources. Thus lockd_up() and lockd_down() can't relay
on current network context. So let's pass corrent one into them.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
Stanislav Kinsbursky 2012-03-29 18:54:33 +04:00 committed by J. Bruce Fields
parent f890edbbef
commit e3f70eadb7
4 changed files with 16 additions and 14 deletions

View file

@ -220,7 +220,7 @@ static int nfsd_startup(unsigned short port, int nrservs)
ret = nfsd_init_socks(port);
if (ret)
goto out_racache;
ret = lockd_up();
ret = lockd_up(&init_net);
if (ret)
goto out_racache;
ret = nfs4_state_start();
@ -229,7 +229,7 @@ static int nfsd_startup(unsigned short port, int nrservs)
nfsd_up = true;
return 0;
out_lockd:
lockd_down();
lockd_down(&init_net);
out_racache:
nfsd_racache_shutdown();
return ret;
@ -246,7 +246,7 @@ static void nfsd_shutdown(void)
if (!nfsd_up)
return;
nfs4_state_shutdown();
lockd_down();
lockd_down(&init_net);
nfsd_racache_shutdown();
nfsd_up = false;
}