All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] lockd: Do not start the lockd thread before we've set nlmsvc_rqst->rq_task
@ 2014-09-02 17:58 Trond Myklebust
  2014-09-02 17:58 ` [PATCH 2/2] nfs: do not start the callback thread until we set rqstp->rq_task Trond Myklebust
  2014-09-02 18:13 ` [PATCH 1/2] lockd: Do not start the lockd thread before we've set nlmsvc_rqst->rq_task Jeff Layton
  0 siblings, 2 replies; 9+ messages in thread
From: Trond Myklebust @ 2014-09-02 17:58 UTC (permalink / raw)
  To: Bruce Fields; +Cc: linux-nfs

This fixes an Oopsable race when starting lockd.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
---
 fs/lockd/svc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index 673668a9eec1..c35cd43a06e6 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;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-09-02 21:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-02 17:58 [PATCH 1/2] lockd: Do not start the lockd thread before we've set nlmsvc_rqst->rq_task Trond Myklebust
2014-09-02 17:58 ` [PATCH 2/2] nfs: do not start the callback thread until we set rqstp->rq_task Trond Myklebust
2014-09-02 18:13   ` Jeff Layton
2014-09-02 19:23   ` Christoph Hellwig
2014-09-02 19:32     ` Trond Myklebust
2014-09-02 19:45       ` J. Bruce Fields
2014-09-02 19:49         ` Trond Myklebust
2014-09-02 21:53           ` J. Bruce Fields
2014-09-02 18:13 ` [PATCH 1/2] lockd: Do not start the lockd thread before we've set nlmsvc_rqst->rq_task Jeff Layton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.