linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hch@infradead.org (Christoph Hellwig)
Subject: [PATCH] nvme: block ioctls if controller not in a live state
Date: Mon, 14 May 2018 07:53:18 -0700	[thread overview]
Message-ID: <20180514145318.GA24711@infradead.org> (raw)
In-Reply-To: <2b21ba25-e581-45a7-95ae-8b3f2fe6dcf8@broadcom.com>

On Mon, May 14, 2018@07:47:46AM -0700, James Smart wrote:
> 
> 
> On 5/14/2018 7:17 AM, Christoph Hellwig wrote:
> > On Wed, May 09, 2018@09:29:13AM -0700, James Smart wrote:
> > > That is the exact intent.? I do want the app to trigger off -EAGAIN in those
> > > two states and try again after a delay./? Perhaps I should change from !LIVE
> > > to NEW || RESETTING || CONNECTING to be more explicit.? I assumed !LIVE was
> > > sufficient as the other states should transition to LIVE or the delete path
> > > is taken which would remove the fd all together.
> > The problem is that userspace reasonably expects to be able to call
> > poll/select when used on a character device and it gets -EAGAIN.
> 
> What's stopping us from adding poll support to the dev node ?

A volunteer to write the code.

> 
> > 
> > Maybe the right solution here is to just do a wait_event_interruptible to
> > wait for the controller being live.
> 
> That's doable. I don't like hanging the app up for what could be 60s or so
> though (controller loss timeout).

Then you need to poll.  We should only do that if opened with O_NONBLOCK
and otherwise wait for the event, similar to the pattern used in a lot
of character devices.

  reply	other threads:[~2018-05-14 14:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-07 22:55 [PATCH] nvme: block ioctls if controller not in a live state James Smart
2018-05-08  7:15 ` Johannes Thumshirn
2018-05-09 23:20   ` James Smart
2018-05-11  5:13     ` Johannes Thumshirn
2018-05-09  5:11 ` Christoph Hellwig
2018-05-09 16:29   ` James Smart
2018-05-14 14:17     ` Christoph Hellwig
2018-05-14 14:47       ` James Smart
2018-05-14 14:53         ` Christoph Hellwig [this message]
2018-06-12 23:11           ` James Smart
2018-06-13  8:09             ` Christoph Hellwig
2018-06-13 14:56               ` James Smart
2018-05-14 15:23 ` Keith Busch
2018-05-14 15:48   ` James Smart

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=20180514145318.GA24711@infradead.org \
    --to=hch@infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).