Skip to content

Commit d71afa9

Browse files
Yihang Limartinkpetersen
authored andcommitted
scsi: scsi_transport_sas: Fix the maximum channel scanning issue
After commit 37c4e72 ("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: 37c4e72 ("scsi: Fix sas_user_scan() to handle wildcard and multi-channel scans") Signed-off-by: Yihang Li <[email protected]> Reviewed-by: John Garry <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 1333eee commit d71afa9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/scsi/scsi_transport_sas.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1734,7 +1734,7 @@ static int sas_user_scan(struct Scsi_Host *shost, uint channel,
17341734
break;
17351735

17361736
default:
1737-
if (channel < shost->max_channel) {
1737+
if (channel <= shost->max_channel) {
17381738
res = scsi_scan_host_selected(shost, channel, id, lun,
17391739
SCSI_SCAN_MANUAL);
17401740
} else {

0 commit comments

Comments
 (0)