From: Brian Bunker <brian@purestorage.com>
To: linux-scsi@vger.kernel.org
Cc: "Martin K . Petersen" <mkp@kernel.org>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
James.Bottomley@HansenPartnership.com,
Hannes Reinecke <hare@suse.de>,
Bart Van Assche <bvanassche@acm.org>,
krishna.kant@purestorage.com,
Brian Bunker <brian@purestorage.com>
Subject: [PATCH v6 0/5] scsi: Refresh INQUIRY data and reprobe on rescan
Date: Mon, 12 Oct 2026 14:05:01 -0700 [thread overview]
Message-ID: <20261012210511.16061-1-brian@purestorage.com> (raw)
This series teaches the SCSI rescan path to refetch standard INQUIRY data
and reprobe the device when the peripheral qualifier or device type has
changed. The motivating case is an ALUA target that transitions through
the "unavailable" state and afterwards reports a different peripheral
qualifier; today the kernel keeps the stale INQUIRY data and the device's
sysfs attributes diverge from what the target reports.
1/5 serializes the INQUIRY-derived sysfs attributes under
sdev->inquiry_mutex so a concurrent reprobe cannot tear the read.
2/5 adds scsi_update_inquiry_data() as the single point that copies a
freshly-fetched INQUIRY buffer into sdev and updates derived fields.
Returns SCSI_INQ_REPROBE_NEEDED only when peripheral qualifier or
device type changes, as these are the only fields that determine
driver binding.
3/5 refactors scsi_add_lun() to use scsi_update_inquiry_data(), sharing
one implementation between initial-probe and reprobe paths.
4/5 teaches scsi_rescan_device() to refetch INQUIRY and reprobe the
device when scsi_update_inquiry_data() reports a change.
5/5 wires the same path into scsi_probe_and_add_lun() so existing
devices encountered during a SCAN_LUNS pass get refreshed.
Changes since v5:
- v5 was applied to 7.3/scsi-staging but did not make it into
7.3/scsi-queue. This version is a rebase onto 7.4/scsi-staging
with no functional changes.
- 2/5: Resolved a context conflict in include/scsi/scsi_device.h
with the removal of the scsi_device_from_queue() export.
- 5/5: Resolved a context conflict in scsi_probe_and_add_lun() with
"scsi: core: Pass the SCSI host pointer directly to scanning
functions"; shost is now a function parameter, so the local
shost declaration is dropped.
- Build-tested with gcc W=1 and with clang 23 with
CONFIG_WARN_CONTEXT_ANALYSIS=y; no new warnings.
- All patches carry Reviewed-by: Hannes Reinecke from v5.
v5 cover-letter Message-ID: <20260618233508.97960-1-brian@purestorage.com>
v4 cover-letter Message-ID: <20260530002019.47109-1-brian@purestorage.com>
v3 cover-letter Message-ID: <20260429224939.77082-1-brian@purestorage.com>
v2 cover-letter Message-ID: <20260429012733.40855-1-brian@purestorage.com>
v1 cover-letter Message-ID: <20260424215324.99045-1-brian@purestorage.com>
Brian Bunker (5):
scsi: core: Protect INQUIRY sysfs attributes with mutex
scsi: core: Add scsi_update_inquiry_data() for updating INQUIRY data
scsi: core: Refactor scsi_add_lun() to use scsi_update_inquiry_data()
scsi: core: Add device reprobe support to scsi_rescan_device()
scsi: core: Handle reprobe for existing devices during SCSI scan
drivers/scsi/scsi.c | 178 +++++++++++++++++++
drivers/scsi/scsi_scan.c | 353 +++++++++++++++++++++++++------------
drivers/scsi/scsi_sysfs.c | 28 ++-
include/scsi/scsi_device.h | 13 ++
4 files changed, 447 insertions(+), 125 deletions(-)
base-commit: 2f4880c22e838d54eae9ab153b0f8dce60531bf1
--
2.55.0
next reply other threads:[~2026-10-12 21:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 21:05 Brian Bunker [this message]
2026-10-12 21:05 ` [PATCH v6 1/5] scsi: core: Protect INQUIRY sysfs attributes with mutex Brian Bunker
2026-10-12 21:05 ` [PATCH v6 2/5] scsi: core: Add scsi_update_inquiry_data() for updating INQUIRY data Brian Bunker
2026-10-12 21:27 ` sashiko-bot
2026-10-13 10:02 ` Damien Le Moal
2026-10-12 21:05 ` [PATCH v6 3/5] scsi: core: Refactor scsi_add_lun() to use scsi_update_inquiry_data() Brian Bunker
2026-10-12 21:27 ` sashiko-bot
2026-10-12 21:05 ` [PATCH v6 4/5] scsi: core: Add device reprobe support to scsi_rescan_device() Brian Bunker
2026-10-12 21:27 ` sashiko-bot
2026-10-12 21:05 ` [PATCH v6 5/5] scsi: core: Handle reprobe for existing devices during SCSI scan Brian Bunker
2026-10-12 21:24 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261012210511.16061-1-brian@purestorage.com \
--to=brian@purestorage.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=bvanassche@acm.org \
--cc=hare@suse.de \
--cc=krishna.kant@purestorage.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mkp@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.