Martin, Ben, Hannes,

Thanks for digging into this. Some target-side data from FlashArray
(Purity) on the unit attention question, inline below.

On Thu, 2026-11-12, Martin Wilck wrote:
> The kernel does *not* rescan devices on receiving a UA with ASC/ASCQ
> 3f/0e ("REPORT LUNS data has changed"). AFAIU, it isn't well defined
> what condition a given storage array actually establishes when a LUN
> mapping changes. 3f/03 and 3f/0e are both possible, as is 29/xx "Power
> on or device reset occured". 3f/0e may actually be received on a
> different LUN than the one that had actually changed.

Purity sends 3f/0e (REPORTED LUNS DATA HAS CHANGED) on any ACL change
for a host, whether a volume is added or removed. It does not use 3f/03
for this.

This UA behaves differently from most others. It is path-scoped (I-T),
not I-T-L. The first LUN to receive a command on a path gets it, and it
is then cleared for that path. The LUN that receives it is never the
LUN that changed:

 - A LUN being added doesn't exist yet on the initiator, so it can't
   receive the UA.
 - A LUN being removed has lost its permissions, so it is unreachable
   on that path and no UA is presented on it.

The UA is therefore always seen on some other, unrelated LUN. A LUN
whose mapping changed can never expect to receive one for itself.

The kernel emits the uevent (SDEV_UA=REPORTED_LUNS_DATA_HAS_CHANGED)
but does not rescan. Pure's best practices recommend installing the
libstorage-mgmt package on hosts. It ships a udev rule (scsi-ua.rules)
that runs scan-scsi-target on that event:

  ACTION=="change", SUBSYSTEM=="scsi", 
ENV{SDEV_UA}=="REPORTED_LUNS_DATA_HAS_CHANGED", RUN+="scan-scsi-target 
$env{DEVPATH}"

The scan runs per path and adds devices for any new LUNs, and multipath
assembles them into a map. This gives automatic volume discovery, so
admins don't have to rescan every connected host after a connect. Hosts
without the package don't get this behavior.

> So, of 3f/0e or 29/xx occurs, the VPD data may be stale. And of course
> also if the LUN mapping changes without any event occuring, as
> discussed in the past in the context of the "recheck_wwid" option. Only
> actively writing to the "rescan" sysfs attribute would fix this.

Reusing a LUN number for a different volume is fine when cleanup of the
previous volume is complete. The old devices are gone, so the new
connect is an ordinary add. Purity sends 3f/0e, the rule rescans each
path, and new devices and a new map are created. Nothing stale is
revived.

The problem case is user error: reusing the LUN number before that
cleanup has finished. Cleanup is asynchronous, and the array can't wait
on it. The sequence is:

 1. Volume A is disconnected from a LUN.
 2. Before the host has removed the old devices, volume B is connected
    at the same LUN number.
 3. The array sends 3f/0e as usual, and the rescan runs. The sd devices
    for that H:C:T:L still exist, so there is nothing to add.
 4. The previously disconnected paths come back, now serving volume B,
    under a map built for volume A.

The UA and the rescan don't help here, and no per-LUN 3f/03 is sent for
those paths. That is the PURE-503945 case. It is the "something changed
behind the initiator's back" scenario, and recheck_wwid detects it.
purge_disconnected is meant to remove the stale paths before this can
happen.

> Thinking about this, it might make sense to switch from sysfs to SG_IO
> in udev rules if we observe a 3f/0e or 29/xx UA.

 - On Purity, sysfs VPD can be stale for these resurrected paths. The
   kernel refresh depends on 3f/03, which isn't sent.
 - Using SG_IO after a 3f/0e or 29/xx UA is reasonable. On Purity it
   would trigger on a path-level event that lands on an unrelated LUN.
   So udev or multipathd can't rely on the event arriving on the LUN
   that changed.
 - That favors verifying the WWID with SG_IO when a path is re-added,
   as the patch does, rather than trusting sysfs or waiting for a
   per-LUN signal. recheck_wwid is a safety net for an operator mistake
   that the array can't prevent. It isn't compensating for a normal
   discovery gap, so the extra SG_IO is only exercised in the error
   case.

> Brian's patch would add more such ioctls and thus increase the
> likelihood of observing a stall. To be observed.

On stalls, I'm not aware of Purity stalling INQUIRY or VPD requests on
healthy paths.

On Thu, 2026-11-12, Benjamin Marzinski wrote:
> Since recheck_wwid is set, we could just limit this new
> check_path_wwid_change() check in ev_add_path() to paths that are up.

That works for me. The resurrected paths described above answer again,
so they are up when the check runs. Paths that aren't up yet are
covered by recheck_wwid once they come up.

Brian

Reply via email to