Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH 0/6] scsi: Support ALUA unavailable state and INQUIRY changes
@ 2026-04-24 21:53 Brian Bunker
  2026-04-24 21:53 ` [PATCH 1/6] scsi: Add INQUIRY data field definitions and accessor helpers Brian Bunker
                   ` (5 more replies)
  0 siblings, 6 replies; 22+ messages in thread
From: Brian Bunker @ 2026-04-24 21:53 UTC (permalink / raw)
  To: hare, linux-scsi; +Cc: Brian Bunker

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(-)

-- 
2.50.1 (Apple Git-155)


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2026-05-05 17:13 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-24 21:53 [PATCH 0/6] scsi: Support ALUA unavailable state and INQUIRY changes Brian Bunker
2026-04-24 21:53 ` [PATCH 1/6] scsi: Add INQUIRY data field definitions and accessor helpers Brian Bunker
2026-04-27  8:19   ` Hannes Reinecke
2026-04-30 15:50   ` Bart Van Assche
2026-04-24 21:53 ` [PATCH 2/6] scsi: Protect INQUIRY sysfs attributes with mutex Brian Bunker
2026-04-27  8:22   ` Hannes Reinecke
2026-04-29  1:27     ` [PATCH v2 " Brian Bunker
2026-04-29 21:06       ` Damien Le Moal
2026-04-29 21:15       ` Bart Van Assche
2026-04-29 22:49       ` [PATCH v3 " Brian Bunker
2026-04-30  6:03         ` Hannes Reinecke
2026-04-30 15:48         ` Bart Van Assche
2026-05-01 22:11           ` Brian Bunker
2026-05-02 16:37             ` Bart Van Assche
2026-05-03 15:44               ` Bart Van Assche
2026-05-04 18:36                 ` Brian Bunker
2026-05-05  8:24                   ` Bart Van Assche
2026-05-05 17:13                     ` Brian Bunker
2026-04-24 21:53 ` [PATCH 3/6] scsi: Add scsi_update_inquiry_data() for updating INQUIRY data Brian Bunker
2026-04-24 21:53 ` [PATCH 4/6] scsi: Refactor scsi_add_lun() to use scsi_update_inquiry_data() Brian Bunker
2026-04-24 21:53 ` [PATCH 5/6] scsi: Add device reprobe support to scsi_rescan_device() Brian Bunker
2026-04-24 21:53 ` [PATCH 6/6] scsi: Handle reprobe for existing devices during SCSI scan Brian Bunker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox