Skip to content

Commit 9eacec5

Browse files
longlimsftmartinkpetersen
authored andcommitted
scsi: storvsc: Process unsupported MODE_SENSE_10
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: 89ae7d7 ("Staging: hv: storvsc: Move the storage driver out of the staging area") Cc: stable@kernel.org Signed-off-by: Long Li <longli@microsoft.com> Reviewed-by: Michael Kelley <mhklinux@outlook.com> Link: https://patch.msgid.link/20260117010302.294068-1-longli@linux.microsoft.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 901a5f3 commit 9eacec5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/scsi/storvsc_drv.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,7 @@ static void storvsc_on_io_completion(struct storvsc_device *stor_device,
11441144
* The current SCSI handling on the host side does
11451145
* not correctly handle:
11461146
* INQUIRY command with page code parameter set to 0x80
1147-
* MODE_SENSE command with cmd[2] == 0x1c
1147+
* MODE_SENSE and MODE_SENSE_10 command with cmd[2] == 0x1c
11481148
* MAINTENANCE_IN is not supported by HyperV FC passthrough
11491149
*
11501150
* Setup srb and scsi status so this won't be fatal.
@@ -1154,6 +1154,7 @@ static void storvsc_on_io_completion(struct storvsc_device *stor_device,
11541154

11551155
if ((stor_pkt->vm_srb.cdb[0] == INQUIRY) ||
11561156
(stor_pkt->vm_srb.cdb[0] == MODE_SENSE) ||
1157+
(stor_pkt->vm_srb.cdb[0] == MODE_SENSE_10) ||
11571158
(stor_pkt->vm_srb.cdb[0] == MAINTENANCE_IN &&
11581159
hv_dev_is_fc(device))) {
11591160
vstor_packet->vm_srb.scsi_status = 0;

0 commit comments

Comments
 (0)