Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66f09ca7 authored by Trond Myklebust's avatar Trond Myklebust Committed by J. Bruce Fields
Browse files

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: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Reviewed-by: default avatarJeff Layton <jlayton@primarydata.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent d4e89902
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -235,7 +235,7 @@ static int nfs_callback_start_svc(int minorversion, struct rpc_xprt *xprt,

	cb_info->serv = serv;
	cb_info->rqst = rqstp;
	cb_info->task = kthread_run(callback_svc, cb_info->rqst,
	cb_info->task = kthread_create(callback_svc, cb_info->rqst,
				    "nfsv4.%u-svc", minorversion);
	if (IS_ERR(cb_info->task)) {
		ret = PTR_ERR(cb_info->task);
@@ -245,6 +245,7 @@ static int nfs_callback_start_svc(int minorversion, struct rpc_xprt *xprt,
		return ret;
	}
	rqstp->rq_task = cb_info->task;
	wake_up_process(cb_info->task);
	dprintk("nfs_callback_up: service started\n");
	return 0;
}