race between nvme device creation and discovery?

Daniel Wagner dwagner at suse.de
Mon Feb 5 02:17:43 PST 2024


On Mon, Feb 05, 2024 at 11:07:48AM +0100, Daniel Wagner wrote:
> On Mon, Feb 05, 2024 at 10:20:54AM +0100, Maurizio Lombardi wrote:
> > po 5. 2. 2024 v 10:20 odesílatel Maurizio Lombardi <mlombard at redhat.com> napsal:
> > >
> > > 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.
> > 
> > This is the problem I was talking about
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2eb94dd56a4a4e3fe286def3e2ba207804a37345
> 
> We have a 'state' attribute in sysfs already, though the
> NVME_CTRL_STARTED_ONCE is modelled as flag. Not sure how this fits
> together yet, so let me play with this.

If I got this right, we could just filter out all controllers which are
in the NEW state, because all transports trigger the connect code right
after the NEW state. At this point the sysfs should be completely
populated.



More information about the Linux-nvme mailing list