Thread (18 messages) 18 messages, 6 authors, 2021-03-09

Re: [PATCH 1/4] nvme: simplify error logic in nvme_validate_ns()

From: Hannes Reinecke <hare@suse.de>
Date: 2021-02-26 09:24:59

On 2/26/21 10:10 AM, Daniel Wagner wrote:
Hi Hannes,

On Fri, Feb 26, 2021 at 08:17:25AM +0100, Hannes Reinecke wrote:
quoted
@@ -4045,7 +4045,7 @@ static void nvme_validate_ns(struct nvme_ns *ns, struct nvme_ns_ids *ids)
  	if (ret)
  		goto out;
  
-	ret = -ENODEV;
+	ret = NVME_SC_INVALID_NS | NVME_SC_DNR;
  	if (!nvme_ns_ids_equal(&ns->head->ids, ids)) {
  		dev_err(ns->ctrl->device,
  			"identifiers changed for nsid %d\n", ns->head->ns_id);
@@ -4063,7 +4063,7 @@ static void nvme_validate_ns(struct nvme_ns *ns, struct nvme_ns_ids *ids)
  	 *
  	 * TODO: we should probably schedule a delayed retry here.
  	 */
-	if (ret && ret != -ENOMEM && !(ret > 0 && !(ret & NVME_SC_DNR)))
+	if (ret > 0 && (ret & NVME_SC_DNR))
  		nvme_ns_remove(ns);
I think Chao's comment still holds, nvme_update_ns_info() can return
-EINVAL, -IEO or -ENODEV. Don't we have to remove the NS in these
cases?
I thought I had fixed up all instances where we can return -ENODEV; and 
all others are indeed transport or transient error which should not 
result in a namespace removal.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help