All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Bruce Fields <bfields@redhat.com>, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 2/2] nfs: do not start the callback thread until we set rqstp->rq_task
Date: Tue, 2 Sep 2014 12:23:28 -0700	[thread overview]
Message-ID: <20140902192328.GA3873@infradead.org> (raw)
In-Reply-To: <1409680738-12491-2-git-send-email-trond.myklebust@primarydata.com>

On Tue, Sep 02, 2014 at 01:58:58PM -0400, Trond Myklebust wrote:
> This fixes an Oopsable race when starting up the callback server.
> 
> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
> ---
>  fs/nfs/callback.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> 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,
>  
>  	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);

Wouldn't it be cleaner to do something like:

-	cb_info->task = kthread_run(callback_svc, cb_info->rqst,
+	cb_info->task = rqstp->rq_run =
+		kthread_create(callback_svc, cb_info->rqst,

or am I missing something subtile that the changelog didn't mention?

  parent reply	other threads:[~2014-09-02 19:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140902192328.GA3873@infradead.org \
    --to=hch@infradead.org \
    --cc=bfields@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.