Skip to contentSkip to conversation

scsi: storvsc: Process unsupported MODE_SENSE_10

PATCH Superseded [email protected] 3 participants 3 messages Jan 7 – Jan 12

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: storvsc: Process unsupported MODE_SENSE_10

From: Long Li <[email protected]>

The Hyper-V host does not support MODE_SENSE_10 and MODE_SENSE. The driver handles MODE_SENSE as unsupported command, but not for MODE_SENSE_10. Add MODE_SENSE_10 to the same handling logic and return correct code to SCSI layer.

Fixes 89ae7d709357 ("Staging: hv: storvsc: Move the storage driver out of the staging area")
---
 drivers/scsi/storvsc_drv.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/storvsc_drv.c +1 -0
index 6e4112143c76..9b15784e2d64 100644
@@ -1154,6 +1154,7 @@ static void storvsc_on_io_completion(struct storvsc_device *stor_device,
 
 	if ((stor_pkt->vm_srb.cdb[0] == INQUIRY) ||
 	   (stor_pkt->vm_srb.cdb[0] == MODE_SENSE) ||
+	   (stor_pkt->vm_srb.cdb[0] == MODE_SENSE_10) ||
 	   (stor_pkt->vm_srb.cdb[0] == MAINTENANCE_IN &&
 	   hv_dev_is_fc(device))) {
 		vstor_packet->vm_srb.scsi_status = 0;
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

From: [email protected] <[email protected]> Sent: Wednesday, January 7, 2026 11:57 AM

Quoted 25 lines

The Hyper-V host does not support MODE_SENSE_10 and MODE_SENSE. The driver handles MODE_SENSE as unsupported command, but not for MODE_SENSE_10. Add MODE_SENSE_10 to the same handling logic and return correct code to SCSI layer.

Fixes 89ae7d709357 ("Staging: hv: storvsc: Move the storage driver out of the staging area")
---
 drivers/scsi/storvsc_drv.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/storvsc_drv.c +1 -0
index 6e4112143c76..9b15784e2d64 100644
@@ -1154,6 +1154,7 @@ static void storvsc_on_io_completion(struct storvsc_device
 *stor_device,
 
 	if ((stor_pkt->vm_srb.cdb[0] == INQUIRY) ||
 	   (stor_pkt->vm_srb.cdb[0] == MODE_SENSE) ||
+	   (stor_pkt->vm_srb.cdb[0] == MODE_SENSE_10) ||
 	   (stor_pkt->vm_srb.cdb[0] == MAINTENANCE_IN &&
 	   hv_dev_is_fc(device))) {
Quoted 1 line

vstor_packet->vm_srb.scsi_status = 0;

There's a code comment above this "if" statement that describes the situation. The comment specifically lists INQUIRY, MODE_SENSE, and MAINTENANCE_IN. For consistency, it should be updated to include MODE_SENSE_10.

With the comment updated,

#2 lore raw
Quoted 15 lines
Quoted 9 lines
drivers/scsi/storvsc_drv.c +1 -0
@@ -1154,6 +1154,7 @@ static void storvsc_on_io_completion(struct
 storvsc_device *stor_device,
 
 	if ((stor_pkt->vm_srb.cdb[0] == INQUIRY) ||
 	   (stor_pkt->vm_srb.cdb[0] == MODE_SENSE) ||
+	   (stor_pkt->vm_srb.cdb[0] == MODE_SENSE_10) ||
 	   (stor_pkt->vm_srb.cdb[0] == MAINTENANCE_IN &&
 	   hv_dev_is_fc(device))) {

vstor_packet->vm_srb.scsi_status = 0;

There's a code comment above this "if" statement that describes the situation. The comment specifically lists INQUIRY, MODE_SENSE, and MAINTENANCE_IN. For consistency, it should be updated to include MODE_SENSE_10.

Quoted 3 lines

With the comment updated,

Will send v2, thank you.

Long