[PATCH-4.7 2/3] NVMe: Short-cut removal on surprise hot-unplug

Christoph Hellwig hch at infradead.org
Tue May 3 01:01:40 PDT 2016


> @@ -1584,6 +1593,9 @@ void nvme_remove_namespaces(struct nvme_ctrl *ctrl)
>  {
>  	struct nvme_ns *ns, *next;
>  
> +	if (ctrl->state == NVME_CTRL_DEAD)
> +		nvme_kill_queues(ctrl);
> +
>  	mutex_lock(&ctrl->namespaces_mutex);
>  	list_for_each_entry_safe(ns, next, &ctrl->namespaces, list)
>  		nvme_ns_remove(ns);

Not happy about so much magic.. At least add comments explaining why
you're doing this, and that it's just an optimization.



More information about the Linux-nvme mailing list