From mboxrd@z Thu Jan 1 00:00:00 1970 From: keith.busch@intel.com (Keith Busch) Date: Thu, 30 Jun 2016 10:57:51 -0400 Subject: [PATCHv2 1/3] nvme: Remove RCU namespace protection In-Reply-To: <20160630064838.GA1608@infradead.org> References: <1466702946-13065-1-git-send-email-keith.busch@intel.com> <1466702946-13065-2-git-send-email-keith.busch@intel.com> <20160628083137.GA32618@infradead.org> <20160628163512.GB8607@localhost.localdomain> <20160630064838.GA1608@infradead.org> Message-ID: <20160630145750.GC13842@localhost.localdomain> On Wed, Jun 29, 2016@11:48:38PM -0700, Christoph Hellwig wrote: > But we remove it from the list before del_gendisk in > nvme_remove_invalid_namespaces and nvme_scan_ns_list already. I guess > that's fine because we're not going to do I/O on them at this point, Right, we can safely remove them from the list for those other cases precisely because they can't do IO anymore. > but what prevents us form doing this two step removal in > nvme_remove_namespaces? If the controller fails during del_gendisk, we have to kill all the request queues and set capacities to 0 to force del_gendisk to complete. If the namespace isn't in the ctrl->namespace list, the driver can't find the namespace to kill.