From: Jethro Beekman <kernel@jbeekman.nl>
To: Keith Busch <keith.busch@intel.com>
Cc: axboe@fb.com, linux-nvme@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] nvme: Don't add namespaces for locked drives
Date: Mon, 20 Jun 2016 20:50:33 -0700 [thread overview]
Message-ID: <5768B989.3070407@jbeekman.nl> (raw)
In-Reply-To: <20160620225444.GB1448@localhost.localdomain>
On 20-06-16 15:54, Keith Busch wrote:
> On Mon, Jun 20, 2016 at 11:21:09AM -0700, Jethro Beekman wrote:
>> On 20-06-16 08:26, Keith Busch wrote:
>>
>> Would this just be a matter of setting req->retries and checking for it in
>> nvme_req_needs_retry? How does one keep track of the number of tries so far?
>
> I just sent a patch out earlier today to use req->retries to track the
> retry count, and nvme module parameter to set the max retries. I think
> that would fix the long delays you're seeing, assuming the patch is okay.
Your patch "nvme: Limit command retries" works for me and obviates the need for
this patch.
>> You're right, I assumed that admin commands can't have namespace ids, but
>> looking at the spec, that's not the case. Turns out there's a problem with the
>> driver then: nvme_ioctl never includes the ns for NVME_IOCTL_ADMIN_CMD.
>
> The NVME_IOCTL_ADMIN_CMD already takes any namespace identifier the user
> put in that field.
I see, the ns argument is just to specify the queue. I assume userspace is
supposed to obtain the ns using NVME_IOCTL_ID? This seems broken, if I have an
open block device handle I can send commands to any nvme namespace as well as
the controller? I think on the block devices you should only be able to send
commands with your nsid. There was some discussion on the security implications
of this about a year ago [1], and it was decided to fix this, but it doesn't
look like this was actually merged?
[1] http://lists.infradead.org/pipermail/linux-nvme/2015-January/001446.html
Jethro
next prev parent reply other threads:[~2016-06-21 3:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-19 23:06 [PATCH 0/3] nvme: Don't add namespaces for locked drives Jethro Beekman
2016-06-19 23:06 ` [PATCH 1/3] nvme: When scanning namespaces, make sure the drive is not locked Jethro Beekman
2016-06-24 8:12 ` Christoph Hellwig
2016-06-19 23:06 ` [PATCH 2/3] nvme: Add function for NVMe security receive command Jethro Beekman
2016-06-19 23:06 ` [PATCH 3/3] nvme: Check if drive is locked using ATA Security Jethro Beekman
2016-06-24 8:09 ` Christoph Hellwig
2016-06-20 6:46 ` [PATCH 0/3] nvme: Don't add namespaces for locked drives Sagi Grimberg
2016-06-24 8:09 ` Christoph Hellwig
2016-06-20 15:26 ` Keith Busch
2016-06-20 18:21 ` Jethro Beekman
2016-06-20 22:54 ` Keith Busch
2016-06-21 3:50 ` Jethro Beekman [this message]
2016-06-24 7:43 ` Christoph Hellwig
2016-06-24 8:11 ` Christoph Hellwig
2016-06-24 7:37 ` Christoph Hellwig
2016-06-24 7:45 ` Jethro Beekman
2016-06-24 8:00 ` 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=5768B989.3070407@jbeekman.nl \
--to=kernel@jbeekman.nl \
--cc=axboe@fb.com \
--cc=keith.busch@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.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