[PATCH v2] nvme: avoid "(efault)" from nvme_sysfs_show_subsysnqn()
Christoph Hellwig
hch at lst.de
Tue Feb 2 02:58:28 EST 2021
On Tue, Feb 02, 2021 at 01:59:51AM +0100, mwilck at suse.com wrote:
> 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).
More information about the Linux-nvme
mailing list