summaryrefslogtreecommitdiff
path: root/drivers/scsi
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2026-08-07 15:49:49 -0700
committerMartin K. Petersen (Oracle) <mkp@kernel.org>2026-08-13 22:04:50 -0400
commit09982efcc07e739c7e4ac6089e3e521132388b53 (patch)
treea324e985c65434731f0ef5543a1459e5575d3e73 /drivers/scsi
parente70647b25a641b9f5602558839182d036b512de5 (diff)
downloadlinux-next-09982efcc07e739c7e4ac6089e3e521132388b53.tar.gz
linux-next-09982efcc07e739c7e4ac6089e3e521132388b53.zip
scsi: core: Add lock context annotations
Document which functions expect that shost->scan_mutex is held. Reviewed-by: John Garry <john.g.garry@oracle.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://patch.msgid.link/ad5ca37acf8c933a12830c0811c293af54c87573.1786142946.git.bvanassche@acm.org Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/scsi_scan.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index d7e0e9393194..3b82e80e807a 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -1195,6 +1195,7 @@ static int scsi_probe_and_add_lun(struct Scsi_Host *shost,
struct scsi_device **sdevp,
enum scsi_scan_mode rescan,
void *hostdata)
+ __must_hold(&shost->scan_mutex)
{
struct scsi_device *sdev;
unsigned char *result;
@@ -1352,6 +1353,7 @@ static void scsi_sequential_lun_scan(struct Scsi_Host *shost,
struct scsi_target *starget,
blist_flags_t bflags, int scsi_level,
enum scsi_scan_mode rescan)
+ __must_hold(&shost->scan_mutex)
{
uint max_dev_lun;
u64 sparse_lun, lun;
@@ -1444,6 +1446,7 @@ static void scsi_sequential_lun_scan(struct Scsi_Host *shost,
static int scsi_report_lun_scan(struct Scsi_Host *shost,
struct scsi_target *starget, blist_flags_t bflags,
enum scsi_scan_mode rescan)
+ __must_hold(&shost->scan_mutex)
{
unsigned char scsi_cmd[MAX_COMMAND_SIZE];
unsigned int length;
@@ -1769,6 +1772,7 @@ EXPORT_SYMBOL(scsi_rescan_device);
static void __scsi_scan_target(struct Scsi_Host *shost, struct device *parent,
unsigned int channel, unsigned int id, u64 lun,
enum scsi_scan_mode rescan)
+ __must_hold(&shost->scan_mutex)
{
blist_flags_t bflags = 0;
int res;
@@ -1866,6 +1870,7 @@ EXPORT_SYMBOL(scsi_scan_target);
static void scsi_scan_channel(struct Scsi_Host *shost, unsigned int channel,
unsigned int id, u64 lun,
enum scsi_scan_mode rescan)
+ __must_hold(&shost->scan_mutex)
{
uint order_id;