From: jsmart2021@gmail.com (James Smart)
Subject: [PATCH] nvme: block ioctls if controller not in a live state
Date: Wed, 9 May 2018 16:20:19 -0700 [thread overview]
Message-ID: <71188ad3-d815-d24f-2af7-11036806d847@gmail.com> (raw)
In-Reply-To: <20180508071556.455kfgioocke47ju@linux-x5ow.site>
On 5/8/2018 12:15 AM, Johannes Thumshirn wrote:
> On Mon, May 07, 2018@03:55:58PM -0700, James Smart wrote:
>> Rather than allow ioctl-based admin cmds to get intermixed on the admin
>> queue with commands being used to initialize a controller or io commands
>> to go to a controller in reconnect thus possibly hanging, reject them
>> if the controller isn't in the LIVE state. Reject with an -EAGAIN status
>> so that the app knows it could retry.
>
> Shouldn't the nvmf_check_if_read() calls in the transport drivers'
> ->queue_rq() callouts handle this?
>
yes - but if things reach that layer, the return status for the ioctl
can be quite different. (if I read things right) The core routines are
coded so that if there's a hard error, a -Exxx status will be returned.
Otherwise, it returns the nvme_req(req)->status value (assumed positive
big value). Which means, if the if_ready checks reject it, it'll go back
with an NVME_SC_ABORT_REQ status. Which means the cli gets a convoluted
error response. For the cases where it would be blocked by controller
state, I want an -EAGAIN status so that the app knows it can retry and
it should succeed sometime in the future. Any other status - the app
gives up and accepts the status value.
-- james
next prev parent reply other threads:[~2018-05-09 23:20 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 [this message]
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
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=71188ad3-d815-d24f-2af7-11036806d847@gmail.com \
--to=jsmart2021@gmail.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;
as well as URLs for NNTP newsgroup(s).