diff options
| author | Brian Bunker <brian@purestorage.com> | 2026-10-28 17:25:31 -0700 |
|---|---|---|
| committer | Martin K. Petersen (Oracle) <mkp@kernel.org> | 2026-11-08 21:58:41 -0500 |
| commit | 6054ce4233dbc692f50da5517ad459fae1b14ac6 (patch) | |
| tree | b4e1ba347d986030ea4ba8ed3669e770b5c7f5e1 /scripts/Makefile.thinlto | |
| parent | e085b1d6b6aabd6a7dcd9f02135f9376ff39e95a (diff) | |
| download | linux-next-6054ce4233dbc692f50da5517ad459fae1b14ac6.tar.gz linux-next-6054ce4233dbc692f50da5517ad459fae1b14ac6.zip | |
scsi: core: Match ULDs to logical units in the ALUA unavailable state
scsi_bus_match() only matches devices with peripheral qualifier 000b, so
a LU that is in the ALUA unavailable state on a target port when the
host scans it never gets an upper-level driver on that path. When the
target port becomes available again, nothing binds sd and the path stays
unusable until the device is deleted and rescanned. A host that was
already running when the path became unavailable keeps sd bound, so the
result depends on when the host scanned.
Peripheral qualifier 001b cannot be matched on its own: an unmapped LUN
reports it as well, and some targets report every possible LUN in REPORT
LUNS. Binding sd to all of those would create disks with no backing LU.
The SCSI core now reads the access state of a device that supports
target port groups with REPORT TARGET PORT GROUPS before the device is
registered, and an unmapped LUN fails that command. SPC-4 requires a LU
in the unavailable state to report PQ 001b, and the command shows that
the LU is mapped, so record in the device whether it reported PQ 001b
and its access state could be read, and match such a device. sd then
binds to the unavailable path like it does to a standby path, the path
stays in the multipath map as a failed path, and the existing UNIT
ATTENTION handling brings it back when the target port becomes
available.
The decision is made once, at scan time, and not from access_state when
the match is made. access_state follows the ALUA state, but the
peripheral qualifier it relates to does not change after the scan. If
the match depended on access_state, a device scanned in the unavailable
state would stop matching as soon as its path became available, e.g.
when the upper-level driver module is loaded later, or the driver is
rebound, or the ALUA device handler updates access_state before the
driver is probed. It also does not depend on the state that the command
returns, which can already be available if the path recovered between
the INQUIRY and the command.
This is the same situation as a path in the standby state, to which sd
already binds: SPC-4 requires READ CAPACITY in neither state. The
unavailable state does not require MODE SENSE either, which the standby
state does.
The cached INQUIRY data in sysfs keeps the peripheral qualifier reported
at scan time, like the rest of the INQUIRY data; access_state shows the
current ALUA state.
Co-developed-by: Krishna Kant <krishna.kant@purestorage.com>
Signed-off-by: Krishna Kant <krishna.kant@purestorage.com>
Signed-off-by: Brian Bunker <brian@purestorage.com>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Link: https://patch.msgid.link/20261029002531.82824-4-brian@purestorage.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
