scsi: Support ALUA unavailable state and INQUIRY changes
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest6 patches 3 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | scsi: Add INQUIRY data field definitions and accessor helpersinclude/ | +171 | 2 replies | |
| 2/6 | scsi: Protect INQUIRY sysfs attributes with mutexdrivers/ | +67 | 30 replies | |
| 3/6 | scsi: Add scsi_update_inquiry_data() for updating INQUIRY datadrivers/ include/ | +177 | 0 replies | |
| 4/6 | scsi: Refactor scsi_add_lun() to use scsi_update_inquiry_data()drivers/ | +17 | 0 replies | |
| 5/6 | scsi: Add device reprobe support to scsi_rescan_device()drivers/ | +120 | 0 replies | |
| 6/6 | scsi: Handle reprobe for existing devices during SCSI scandrivers/ | +83 | 0 replies |
Reviews trailers per patch
2 of 6 patches have a Reviewed-by or Acked-by.
| Patch | Hannes Reinecke | Damien Le Moal |
|---|---|---|
| 1/6 | R-b | |
| 2/6 | R-b R-b R-b R-b | R-b |
| 3/6 | ||
| 4/6 | ||
| 5/6 | ||
| 6/6 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/6] scsi: Support ALUA unavailable state and INQUIRY changes
The SCSI mid-layer fails to refresh standard INQUIRY data during rescans. This prevents support for the ALUA "unavailable" state, where the Peripheral Qualifier (PQ) toggles between 1 and 0. When a device becomes available, the cached stale PQ prevents upper-layer drivers from attaching.
Additionally, the Unit Attention for "INQUIRY DATA HAS CHANGED" is effectively ignored for identification changes because the rescan does not update standard INQUIRY fields.
Introduce scsi_update_inquiry_data() to refresh the PQ, device type, and identification strings. Use a new inquiry_mutex to protect concurrent sysfs access while the buffer is reallocated.
If a rescan detects a change in PQ or device type, trigger device_reprobe() to automatically match and attach the correct driver.
Fixes added:
- ALUA/UA Fix: Refreshes standard INQUIRY data on rescan.
- Safety: Uses kmemdup and a mutex to prevent Use-After-Free.
- Deadlock Avoidance: Drops device_lock before reprobing.
Brian Bunker (6):
scsi: Add INQUIRY data field definitions and accessor helpers
scsi: Protect INQUIRY sysfs attributes with mutex
scsi: Add scsi_update_inquiry_data() for updating INQUIRY data
scsi: Refactor scsi_add_lun() to use scsi_update_inquiry_data()
scsi: Add device reprobe support to scsi_rescan_device()
scsi: Handle reprobe for existing devices during SCSI scan
drivers/scsi/scsi.c | 164 +++++++++++++++++++ drivers/scsi/scsi_scan.c | 321 +++++++++++++++++++++++++------------ drivers/scsi/scsi_sysfs.c | 74 ++++++++- include/scsi/scsi.h | 171 ++++++++++++++++++++ include/scsi/scsi_device.h | 13 ++ 5 files changed, 635 insertions(+), 108 deletions(-)
Signature · 1 line
2.50.1 (Apple Git-155)