[PATCHv3] nvme: allow to re-attach namespaces after all paths are down

Christoph Hellwig hch at lst.de
Tue May 11 09:26:11 PDT 2021


>  	} else {
>  		ret = -EINVAL;
> +		/*
> +		 * If multipath is enabled we might hit an ns head with no
> +		 * paths, but that doesn't indicate it's a shared namespace.
> +		 */
> +		if (nvme_ns_head_multipath(head) &&
> +		    list_empty(&head->list))
> +			goto check_ids;
>  		if (!is_shared || !head->shared) {
>  			dev_err(ctrl->device,
>  				"Duplicate unshared namespace %d\n", nsid);
>  			goto out_put_ns_head;
>  		}
> +check_ids:

I think this should simply be:

		if (!list_empty(&head->list) && (!is_shared || !head->shared)) {
 			dev_err(ctrl->device,
  				"Duplicate unshared namespace %d\n", nsid);
  			goto out_put_ns_head;
  		}



More information about the Linux-nvme mailing list