diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-09-02 13:58:58 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-09-02 17:53:30 -0400 |
commit | 66f09ca717e7905e0eebe000b86e27d0274b95ac (patch) | |
tree | ec63e3a95616c279d9b5ae6014daf198f0a93603 | |
parent | d4e89902990e3fae1b8d2ca501d2fa5f0657c053 (diff) |
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>
-rw-r--r-- | fs/nfs/callback.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c index e3dd1cd175d9..b8fb3a4ef649 100644 --- a/fs/nfs/callback.c +++ b/fs/nfs/callback.c | |||
@@ -235,7 +235,7 @@ static int nfs_callback_start_svc(int minorversion, struct rpc_xprt *xprt, | |||
235 | 235 | ||
236 | cb_info->serv = serv; | 236 | cb_info->serv = serv; |
237 | cb_info->rqst = rqstp; | 237 | 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, |
239 | "nfsv4.%u-svc", minorversion); | 239 | "nfsv4.%u-svc", minorversion); |
240 | if (IS_ERR(cb_info->task)) { | 240 | if (IS_ERR(cb_info->task)) { |
241 | ret = PTR_ERR(cb_info->task); | 241 | ret = PTR_ERR(cb_info->task); |
@@ -245,6 +245,7 @@ static int nfs_callback_start_svc(int minorversion, struct rpc_xprt *xprt, | |||
245 | return ret; | 245 | return ret; |
246 | } | 246 | } |
247 | rqstp->rq_task = cb_info->task; | 247 | rqstp->rq_task = cb_info->task; |
248 | wake_up_process(cb_info->task); | ||
248 | dprintk("nfs_callback_up: service started\n"); | 249 | dprintk("nfs_callback_up: service started\n"); |
249 | return 0; | 250 | return 0; |
250 | } | 251 | } |