[PATCH] nvme-multipath: call del_gendisk() in nvme_mpath_check_last_path()

Christoph Hellwig hch at lst.de
Thu Jun 3 00:22:44 PDT 2021


> +void nvme_mpath_check_last_path(struct nvme_ns *ns)
>  {
> +	struct nvme_ns_head *head = ns->head;
> +
>  	if (!head->disk)
>  		return;
> -	if (head->disk->flags & GENHD_FL_UP) {
> +
> +	if (list_empty(&head->list) && head->disk->flags & GENHD_FL_UP) {

Please add the braces around the "&".

>  		nvme_cdev_del(&head->cdev, &head->cdev_device);
>  		del_gendisk(head->disk);
>  	}
> +}

Also it seems like we can just pass the head here, no need for ns.

> -	if (head->disk && list_empty(&head->list))
> -		kblockd_schedule_work(&head->requeue_work);

Did this get lost in the new version?



More information about the Linux-nvme mailing list