race between nvme device creation and discovery?

Maurizio Lombardi mlombard at redhat.com
Mon Feb 5 01:20:01 PST 2024


po 5. 2. 2024 v 8:47 odesílatel Daniel Wagner <dwagner at suse.de> napsal:
>
> > While we could add a retry logic to libnvme, I'm not really convinced
> > this is a good idea; in the end, who's to tell how long we should wait?
> > A second? Several seconds? A minute? Several minutes?
> > Also not that sysfs_create_link() has a return code, so the link might
> > not be created at all ...
>
> Yep, retry logics have always a smell too it. What about the idea to
> add some sort of ready attribute to the controller sysfs entry?

I think I had a similar problem with nvme-stas some time ago, it tried
to delete a controller right after it appeared in sysfs, causing race conditions
with the init code path.

Maybe you can take advantage of the NVME_CTRL_STARTED_ONCE, exposing
this information via sysfs with a "ready" or "status" attribute.

Maurizio




More information about the Linux-nvme mailing list