Skip to content

Commit dbe7633

Browse files
kelleymhmartinkpetersen
authored andcommitted
scsi: storvsc: Log TEST_UNIT_READY errors as warnings
Commit 08f7654 ("scsi: storvsc: Update error logging") added more robust logging of errors, particularly those reported as Hyper-V errors. But this change produces extra logging noise in that TEST_UNIT_READY may report errors during the normal course of detecting device adds and removes. Fix this by logging TEST_UNIT_READY errors as warnings, so that log lines are produced only if the storvsc log level is changed to WARN level on the kernel boot line. Link: https://lore.kernel.org/r/[email protected] Fixes: 08f7654 ("scsi: storvsc: Update error logging") Signed-off-by: Michael Kelley <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 9977d88 commit dbe7633

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

drivers/scsi/storvsc_drv.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,14 +1199,24 @@ static void storvsc_on_io_completion(struct storvsc_device *stor_device,
11991199
vstor_packet->vm_srb.sense_info_length);
12001200

12011201
if (vstor_packet->vm_srb.scsi_status != 0 ||
1202-
vstor_packet->vm_srb.srb_status != SRB_STATUS_SUCCESS)
1203-
storvsc_log(device, STORVSC_LOGGING_ERROR,
1202+
vstor_packet->vm_srb.srb_status != SRB_STATUS_SUCCESS) {
1203+
1204+
/*
1205+
* Log TEST_UNIT_READY errors only as warnings. Hyper-V can
1206+
* return errors when detecting devices using TEST_UNIT_READY,
1207+
* and logging these as errors produces unhelpful noise.
1208+
*/
1209+
int loglevel = (stor_pkt->vm_srb.cdb[0] == TEST_UNIT_READY) ?
1210+
STORVSC_LOGGING_WARN : STORVSC_LOGGING_ERROR;
1211+
1212+
storvsc_log(device, loglevel,
12041213
"tag#%d cmd 0x%x status: scsi 0x%x srb 0x%x hv 0x%x\n",
12051214
request->cmd->request->tag,
12061215
stor_pkt->vm_srb.cdb[0],
12071216
vstor_packet->vm_srb.scsi_status,
12081217
vstor_packet->vm_srb.srb_status,
12091218
vstor_packet->status);
1219+
}
12101220

12111221
if (vstor_packet->vm_srb.scsi_status == SAM_STAT_CHECK_CONDITION &&
12121222
(vstor_packet->vm_srb.srb_status & SRB_STATUS_AUTOSENSE_VALID))

0 commit comments

Comments
 (0)