diff mbox series

[1/1] scsi: storvsc: Always set no_report_opcodes

Message ID 1686343101-18930-1-git-send-email-mikelley@microsoft.com
State New
Headers show
Series [1/1] scsi: storvsc: Always set no_report_opcodes | expand

Commit Message

Michael Kelley June 9, 2023, 8:38 p.m. UTC
Hyper-V synthetic SCSI devices do not support the MAINTENANCE_IN SCSI
command, so scsi_report_opcode() always fails, resulting in messages
like this:

hv_storvsc <guid>: tag#205 cmd 0xa3 status: scsi 0x2 srb 0x86 hv 0xc0000001

The recently added support for command duration limits calls
scsi_report_opcode() four times as each device comes online, which
significantly increases the number of messages logged in a system with
many disks.

Fix the problem by always marking Hyper-V synthetic SCSI devices as
not supporting scsi_report_opcode(). With this setting, the
MAINTENANCE_IN SCSI command is not issued and no messages are logged.

Signed-off-by: Michael Kelley <mikelley@microsoft.com>
---
 drivers/scsi/storvsc_drv.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Martin K. Petersen June 15, 2023, 2:15 a.m. UTC | #1
On Fri, 09 Jun 2023 13:38:21 -0700, Michael Kelley wrote:

> Hyper-V synthetic SCSI devices do not support the MAINTENANCE_IN SCSI
> command, so scsi_report_opcode() always fails, resulting in messages
> like this:
> 
> hv_storvsc <guid>: tag#205 cmd 0xa3 status: scsi 0x2 srb 0x86 hv 0xc0000001
> 
> The recently added support for command duration limits calls
> scsi_report_opcode() four times as each device comes online, which
> significantly increases the number of messages logged in a system with
> many disks.
> 
> [...]

Applied to 6.4/scsi-fixes, thanks!

[1/1] scsi: storvsc: Always set no_report_opcodes
      https://git.kernel.org/mkp/scsi/c/31d16e712bdc
diff mbox series

Patch

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index e6bc622..659196a 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1567,6 +1567,8 @@  static int storvsc_device_configure(struct scsi_device *sdevice)
 {
 	blk_queue_rq_timeout(sdevice->request_queue, (storvsc_timeout * HZ));
 
+	/* storvsc devices don't support MAINTENANCE_IN SCSI cmd */
+	sdevice->no_report_opcodes = 1;
 	sdevice->no_write_same = 1;
 
 	/*