From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932221AbcFUDvE (ORCPT ); Mon, 20 Jun 2016 23:51:04 -0400 Received: from jbeekman.nl ([149.210.172.151]:60856 "EHLO daxilon.jbeekman.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752054AbcFUDu5 (ORCPT ); Mon, 20 Jun 2016 23:50:57 -0400 To: Keith Busch References: <20160619230634.17229-1-kernel@jbeekman.nl> <20160620152639.GD12936@localhost.localdomain> <57683415.1060202@jbeekman.nl> <20160620225444.GB1448@localhost.localdomain> Cc: axboe@fb.com, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org From: Jethro Beekman X-Enigmail-Draft-Status: N1110 Message-ID: <5768B989.3070407@jbeekman.nl> Date: Mon, 20 Jun 2016 20:50:33 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <20160620225444.GB1448@localhost.localdomain> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 24.130.121.155 X-SA-Exim-Mail-From: kernel@jbeekman.nl X-Spam-Report: Content analysis details: (-1.0 points, 5.0 required) pts rule name description --- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: infradead.org] Subject: Re: [PATCH 0/3] nvme: Don't add namespaces for locked drives Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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