[PATCH v2] nvme: avoid "(efault)" from nvme_sysfs_show_subsysnqn()

Sagi Grimberg sagi at grimberg.me
Wed Feb 3 05:01:08 EST 2021


>> From: Martin Wilck <mwilck at suse.com>
>>
>> While a controller is still connecting, ctrl->subsys is NULL and
>> thus reading the controller's "subsysnqn" sysfs attribute returns
>> "(efault)". This happens all the time when user space processes
>> "add" events for NVMe controller devices.
>>
>> Fix it by returning the nvmf_ctrl_options' subsysnqn attribute
>> if ctrl->subsys isn't initialized yet.
> 
> This is just papering over symptoms.  We should not be sending
> events or display sysfs files until the controlle is live.
> 
> In other wwords - I think we should remove the cdev_device_add
> from nvme_init_ctrl to nvme_start_ctrl (+ any error handling changes
> resulting from that).

Maybe move it to nvme_init_identify? nvme_start_ctrl is after I/O queues
were created.



More information about the Linux-nvme mailing list