[PATCH V3 2/8] nvme: add sysfs attribute to change admin timeout per nvme controller

Maurizio Lombardi mlombard at arkamax.eu
Wed Apr 22 04:08:44 PDT 2026


On Wed Apr 22, 2026 at 12:10 PM CEST, Daniel Wagner wrote:
> On Fri, Apr 10, 2026 at 09:39:18AM +0200, Maurizio Lombardi wrote:
>> +	/*
>> +	 * Wait until the controller reaches the LIVE state
>> +	 * to be sure that admin_q and fabrics_q are
>> +	 * properly initialized.
>> +	 */
>> +	if (!test_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags))
>> +		return -EBUSY;
>
> I assume the idea is to use an udev rule to set the value. Though I
> think this is racy:
>
> 	nvme_change_uevent(ctrl, "NVME_EVENT=connected");
> 	set_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags);


Not really, the idea was about to prevent the user from setting the
timeouts too early during the controller's initialization.

Otherwise the user could try to change the timeout while
admin_q and fabrics_q are still being created.

if the NVME_CTRL_STARTED_ONCE bit is set, we know that the
initialization has been completed and that admin_q and fabrics_q will
exist until the controller will be torn down.


Maurizio




More information about the Linux-nvme mailing list