On Fri, 2026-11-13 at 11:43 -0800, Brian Bunker wrote: > Martin, Ben, Hannes, > > 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.
Why does this happen after 2.)? Wouldn't the array send 3f/0e immediately after 1.)? If your "purge" functionality was active in multipathd, and/or if the libstoragemgmt udev rules were enabled, the SCSI device would be deleted. With "purge", the block device would be deleted, too, or at least orphaned by multipathd. This should happen even if the host still had some file systems on the old LUN mounted or otherwise used (even though that would be an obvious user mistake). > 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. Right. We'd basically have to rescan every device. Unfortunately, 1) writing to "rescan" updates the sysfs VPDs, but generates no uevent; 2) writing to /sys/host/scsi_host/host$X/scan (this is what "scan-scsi- target" does) neither updates VPDs nor generates uevents; 3) the "inquiry" sysfs attribute is never updated, unless the LUN is deleted and re-added. I believe 1) and 2) could be fixed in a relatively simple way. 3) is a problem, bug I guess we could live with it. > - 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. While you can speak for Purity only ;-) I suppose most storage arrays would try to respond to INQUIRY quickly. But other things can happen. Queues may be full, network timeouts may occur, and fabrics may be overloaded. Regards Martin -- Dr. Martin Wilck <[email protected]> SUSE Software Solutions Germany GmbH, Frankenstr. 146, 90461 Nürnberg, Germany Geschäftsführer: Stefan Gaiser, Jochen Jaser, Abhinav Puri (HRB 36809,AG Nürnberg)
