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

Sagi Grimberg sagi at grimberg.me
Thu Feb 4 02:44:18 EST 2021


>>> I think Christoph is suggesting just wait until we have all the
>>> properties the driver exports rather than specifically exporting only
>>> during a 'live' state. Something like this (untested) should do the
>>> trick:
>>>
>>> ---
>>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
>>> index 1a3cdc6b1036..4c0258d7eb91 100644
>>> --- a/drivers/nvme/host/core.c
>>> +++ b/drivers/nvme/host/core.c
>>> @@ -3069,6 +3069,9 @@ int nvme_init_identify(struct nvme_ctrl *ctrl)
>>>    		if (ret)
>>>    			goto out_free;
>>> +		ret = cdev_device_add(&ctrl->cdev, ctrl->device);
>>> +		if (ret)
>>> +			goto out_free;
>>
>> This happens on every reset, we should probably just do this once?
> 
> Right, and while the function is invoked on each reset, the above code
> sequence happens only once. You can't immediately tell from looking at
> the diff, but it's in the 'if (!ctrl->identified)' code block.

Yea, you're right...



More information about the Linux-nvme mailing list