Skip to contentSkip to conversation

scsi: Fix the maximum channel scanning issue

PATCH Superseded Yihang Li 3 participants 3 messages Mar 13 – Mar 17 SCSI

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Yihang Li

author
#0 lore raw

PATCH 1/1 scsi: Fix the maximum channel scanning issue

After the commit 37c4e72b0651 ("scsi: Fix sas_user_scan() to handle wildcard and multi-channel scans"), if the device supports multiple channels (0 to shost->max_channel), user_scan() invokes updated sas_user_scan() to perform the scan behavior for a specific transfer. However, when the user specifies shost->max_channel, it will return -EINVAL, which is not expected.

Fix and support specifying the scan shost->max_channel for scanning.

Fixes 37c4e72b0651 ("scsi: Fix sas_user_scan() to handle wildcard and multi-channel scans")
---
 drivers/scsi/scsi_transport_sas.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_transport_sas.c +1 -1
index 12124f9d5ccd..13412702188e 100644
@@ -1734,7 +1734,7 @@ static int sas_user_scan(struct Scsi_Host *shost, uint channel,
 		break;
 
 	default:
-		if (channel < shost->max_channel) {
+		if (channel <= shost->max_channel) {
 			res = scsi_scan_host_selected(shost, channel, id, lun,
 						      SCSI_SCAN_MANUAL);
 		} else {
Signature · 1 line
2.33.0
#1 lore raw
Quoted 1 line · Yihang Li

Fix and support specifying the scan shost->max_channel for scanning.

A more specific prefix than "scsi:" should be used for SAS patches. In the kernel log I found the following examples:
* scsi: transport: sas:
* scsi: scsi_transport_sas:

I'm not sure what prefix is preferred.

Thanks,

Bart.

#2 lore raw

Hi, Bart

Quoted 9 lines · Bart Van Assche
Quoted 1 line · Yihang Li

Fix and support specifying the scan shost->max_channel for scanning.

A more specific prefix than "scsi:" should be used for SAS patches. In the kernel log I found the following examples:
* scsi: transport: sas:
* scsi: scsi_transport_sas:

I'm not sure what prefix is preferred.

Thank you for your reply. I will carefully consider this suggestion.

Thanks,
Yihang