summaryrefslogtreecommitdiff
path: root/fs/lockd/svc.c
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-06-25 16:40:07 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-16 09:04:39 -0700
commit0bbc9d1b4b011e83ba65852b1d652561c7f562f1 (patch)
tree0a6e76d8b7e1d473ca92f5358ff2c5fab7f16ba1 /fs/lockd/svc.c
parent0e924ae7ac646cf8aa95a3bc5671d19f920417c5 (diff)
downloadlinux-3.10-0bbc9d1b4b011e83ba65852b1d652561c7f562f1.tar.gz
linux-3.10-0bbc9d1b4b011e83ba65852b1d652561c7f562f1.tar.bz2
linux-3.10-0bbc9d1b4b011e83ba65852b1d652561c7f562f1.zip
Lockd: pass network namespace to creation and destruction routines
upstream commit e3f70eadb7dddfb5a2bb9afff7abfc6ee17a29d0. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/lockd/svc.c')
-rw-r--r--fs/lockd/svc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index f49b9afc443..1ead0750cdb 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -295,11 +295,10 @@ static void lockd_down_net(struct net *net)
/*
* Bring up the lockd process if it's not already up.
*/
-int lockd_up(void)
+int lockd_up(struct net *net)
{
struct svc_serv *serv;
int error = 0;
- struct net *net = current->nsproxy->net_ns;
mutex_lock(&nlmsvc_mutex);
/*
@@ -378,12 +377,12 @@ EXPORT_SYMBOL_GPL(lockd_up);
* Decrement the user count and bring down lockd if we're the last.
*/
void
-lockd_down(void)
+lockd_down(struct net *net)
{
mutex_lock(&nlmsvc_mutex);
if (nlmsvc_users) {
if (--nlmsvc_users) {
- lockd_down_net(current->nsproxy->net_ns);
+ lockd_down_net(net);
goto out;
}
} else {