summaryrefslogtreecommitdiffstats
path: root/fs/lockd
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2014-09-02 13:58:57 -0400
committerJ. Bruce Fields <bfields@redhat.com>2014-09-02 17:49:17 -0400
commitd4e89902990e3fae1b8d2ca501d2fa5f0657c053 (patch)
tree686e185ebf2a0e6e4dac46fbacf036a54295ec48 /fs/lockd
parentccad7dad86d8c42b0aec7a3ce7f911e033bf3c6a (diff)
downloadlinux-stable-d4e89902990e3fae1b8d2ca501d2fa5f0657c053.tar.gz
linux-stable-d4e89902990e3fae1b8d2ca501d2fa5f0657c053.tar.bz2
linux-stable-d4e89902990e3fae1b8d2ca501d2fa5f0657c053.zip
lockd: Do not start the lockd thread before we've set nlmsvc_rqst->rq_task
This fixes an Oopsable race when starting lockd. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Reviewed-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/lockd')
-rw-r--r--fs/lockd/svc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index b416b3355807..09857b48d0c3 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -306,7 +306,7 @@ static int lockd_start_svc(struct svc_serv *serv)
svc_sock_update_bufs(serv);
serv->sv_maxconn = nlm_max_connections;
- nlmsvc_task = kthread_run(lockd, nlmsvc_rqst, "%s", serv->sv_name);
+ nlmsvc_task = kthread_create(lockd, nlmsvc_rqst, "%s", serv->sv_name);
if (IS_ERR(nlmsvc_task)) {
error = PTR_ERR(nlmsvc_task);
printk(KERN_WARNING
@@ -314,6 +314,7 @@ static int lockd_start_svc(struct svc_serv *serv)
goto out_task;
}
nlmsvc_rqst->rq_task = nlmsvc_task;
+ wake_up_process(nlmsvc_task);
dprintk("lockd_up: service started\n");
return 0;