[PATCH] nvme-multipath: call del_gendisk() in nvme_mpath_check_last_path()
Hannes Reinecke
hare at suse.de
Mon Jun 7 02:46:14 PDT 2021
On 6/3/21 9:22 AM, Christoph Hellwig wrote:
>> +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 "&".
>
Ok.
>> 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.
>
Ok.
>> - if (head->disk && list_empty(&head->list))
>> - kblockd_schedule_work(&head->requeue_work);
>
> Did this get lost in the new version?
>
I had removed it as it'll be called from nvme_mpath_remove_disk()
anyway, but seeing that the refcount might induce a different lifetime
I'll be re-adding it.
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare at suse.de +49 911 74053 688
SUSE Software Solutions Germany GmbH, 90409 Nürnberg
GF: F. Imendörffer, HRB 36809 (AG Nürnberg)
More information about the Linux-nvme
mailing list