Skip to content

Commit 66f09ca

Browse files
trondmypdJ. Bruce Fields
authored andcommitted
nfs: do not start the callback thread until we set rqstp->rq_task
This fixes an Oopsable race when starting up the callback server. 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>
1 parent d4e8990 commit 66f09ca

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎fs/nfs/callback.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ static int nfs_callback_start_svc(int minorversion, struct rpc_xprt *xprt,
235235

236236
cb_info->serv = serv;
237237
cb_info->rqst = rqstp;
238-
cb_info->task = kthread_run(callback_svc, cb_info->rqst,
238+
cb_info->task = kthread_create(callback_svc, cb_info->rqst,
239239
"nfsv4.%u-svc", minorversion);
240240
if (IS_ERR(cb_info->task)) {
241241
ret = PTR_ERR(cb_info->task);
@@ -245,6 +245,7 @@ static int nfs_callback_start_svc(int minorversion, struct rpc_xprt *xprt,
245245
return ret;
246246
}
247247
rqstp->rq_task = cb_info->task;
248+
wake_up_process(cb_info->task);
248249
dprintk("nfs_callback_up: service started\n");
249250
return 0;
250251
}

0 commit comments

Comments
 (0)