[PATCH v2 1/5] nvme: reject a reconnect_delay of 0 through sysfs

Guixin Liu kanie at linux.alibaba.com
Mon Nov 9 18:36:15 PST 2026



在 2026/11/10 01:54, Keith Busch 写道:
> On Mon, Nov 09, 2026 at 10:26:42AM +0800, Guixin Liu wrote:
>> nvme_ctrl_reconnect_delay_store() accepts any value the option parser
>> also accepts, except that it misses the lower bound: writing 0 is
>> rejected by nvmf_parse_options() but not by the sysfs attribute.
>> nvme_ctrl_loss_tmo_store() then divides by opts->reconnect_delay in
>> DIV_ROUND_UP(), so writing 0 followed by any ctrl_loss_tmo update
>> crashes the kernel with a division by zero.
>>
>> Reject 0 like the option parser does.
> There was another patch sent earlier with an identical fix posted here:
>
>   https://lore.kernel.org/linux-nvme/20261105215807526OqR0Bg86VChvwhCEz5xGr@zte.com.cn/
>
> I ended up applying the one that published first, but removed the
> unnecessary code comments.
OK, and could you please apply the number 4 patch too? I will drop the two
patches which you applied in v3, thanks.

Best Regards,
Guixin Liu




More information about the Linux-nvme mailing list