From: Christoph Hellwig <hch@lst.de>
To: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: Race in bl_resolve_deviceid?
Date: Thu, 15 Jan 2015 16:12:54 +0100 [thread overview]
Message-ID: <20150115151254.GA13124@lst.de> (raw)
In-Reply-To: <CAHQdGtTqYi0krW6b9w0Bxe-UJkP1nPZEJdCEMYb5XTA91rBtLw@mail.gmail.com>
On Wed, Jan 14, 2015 at 11:51:37AM -0500, Trond Myklebust wrote:
> Hi Christoph,
>
> bl_resolve_deviceid() has:
>
> add_wait_queue(&nn->bl_wq, &wq);
> rc = rpc_queue_upcall(nn->bl_device_pipe, msg);
> if (rc < 0) {
> remove_wait_queue(&nn->bl_wq, &wq);
> goto out_free_data;
> }
>
> set_current_state(TASK_UNINTERRUPTIBLE);
> schedule();
> remove_wait_queue(&nn->bl_wq, &wq);
>
>
> Doesn't that call to 'set_current_state()' need to come before the
> rpc_queue_upcall() if you want the wait for the downcall to be
> race-free? It looks to me as if the right thing to do here is to
> replace the above with a prepare_to_wait()/finish_wait() pair...
That code predates my involvement with the block layout driver,
but from a quick inspecion I'd say you're right. Let me cook up
a patch and run it through testing.
next prev parent reply other threads:[~2015-01-15 15:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-14 16:51 Race in bl_resolve_deviceid? Trond Myklebust
2015-01-15 15:12 ` Christoph Hellwig [this message]
2015-01-23 13:41 ` Christoph Hellwig
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=20150115151254.GA13124@lst.de \
--to=hch@lst.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox