Martin, Ben,

Before I post a v5, here is where I stand on the open points, so we can
agree on a direction first.

On Fri, 2026-11-13, Martin Wilck wrote:
> We need to trust udev at some point, don't we?

Yes, and checking once is intentional: the check is meant to catch a
stale or wrong uevent, and the retriggered event carries fresh data.

In the code, uev_update_path() sets needs_reinit in two places: for
INIT_REQUESTED_UDEV, and for a changed udev WWID. I would pass
PATH_ADD_REINIT only from the changed-WWID branch. The retriggered event
then takes the normal path and trusts udev. No new init states or flags
are needed, and a persistently wrong ID_SERIAL can't cause repeated
checks.

> Yet another possibility is to introduce a new mode where we just never
> trust udev.

I would keep that out of this patch. It would add SG_IO calls to every
event, which is the stall risk you raised, and it deserves its own
discussion and data. It could become a value of recheck_wwid later.

> In my mind, a changed WWID followed by a failure to obtain the WWID
> from the device shows that something is really fishy about the path
> in question.

For this patch I side with Ben: if the check fails, trust what udev gave
us. A failed SG_IO on a path suggests the path is unhealthy, and
recheck_wwid will recheck it when it comes back up. Allowing a fallback
to SG_IO in get_uid() when udev fails seems reasonable to me as a
separate change.

> I suppose we could rescan asynchronously in this case.

I support that as a follow-up. On Purity, scan-scsi-target doesn't
refresh VPD for existing devices, so an explicit rescan is the only way
to correct stale sysfs data. I would rather not add it to this patch,
because it touches the regular changed-WWID path in uev_update_path().

So for v5 I plan to:

 - lower the log level of the new message to 2 or 3,
 - set pp->tick = conf->retrigger_delay, as pathinfo() does,
 - limit the check to paths that are up, as Ben suggested,
 - pass PATH_ADD_REINIT only from the changed-WWID branch.

Does that match what you have in mind?

Brian

Reply via email to