Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: storvsc: Update error logging

When an I/O error is reported by the underlying Hyper-V host, current code
provides details only when the logging level is set to WARN, making it more
difficult to diagnose problems in live customer situations. Fix this by
reporting details at ERROR level, which is the default. Also add more
information, including the Hyper-V error code, and the tag # so that the
message can be matched with messages at the SCSI and blk-mq levels.

Also, sense information logging is inconsistent and duplicative. The
existence of sense info is first logged at WARN level, and then full sense
info is logged at ERROR level. Fix this by removing the logging of the
existence of sense info, and change the logging of full sense info to WARN
level in favor of letting the generic SCSI layer handle such logging. With
the change to WARN level, it's no longer necessary to filter out as noise
any NOT READY sense info generated by the virtual DVD device.

Link: https://lore.kernel.org/r/1622827263-12516-2-git-send-email-mikelley@microsoft.com
Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Michael Kelley and committed by
Martin K. Petersen
08f76547 d4674859

+10 -9
+10 -9
drivers/scsi/storvsc_drv.c
··· 1090 1090 struct Scsi_Host *host; 1091 1091 u32 payload_sz = cmd_request->payload_sz; 1092 1092 void *payload = cmd_request->payload; 1093 + bool sense_ok; 1093 1094 1094 1095 host = stor_dev->host; 1095 1096 ··· 1100 1099 scmnd->result = vm_srb->scsi_status; 1101 1100 1102 1101 if (scmnd->result) { 1103 - if (scsi_normalize_sense(scmnd->sense_buffer, 1104 - SCSI_SENSE_BUFFERSIZE, &sense_hdr) && 1105 - !(sense_hdr.sense_key == NOT_READY && 1106 - sense_hdr.asc == 0x03A) && 1107 - do_logging(STORVSC_LOGGING_ERROR)) 1102 + sense_ok = scsi_normalize_sense(scmnd->sense_buffer, 1103 + SCSI_SENSE_BUFFERSIZE, &sense_hdr); 1104 + 1105 + if (sense_ok && do_logging(STORVSC_LOGGING_WARN)) 1108 1106 scsi_print_sense_hdr(scmnd->device, "storvsc", 1109 1107 &sense_hdr); 1110 1108 } ··· 1173 1173 1174 1174 if (vstor_packet->vm_srb.scsi_status != 0 || 1175 1175 vstor_packet->vm_srb.srb_status != SRB_STATUS_SUCCESS) 1176 - storvsc_log(device, STORVSC_LOGGING_WARN, 1177 - "cmd 0x%x scsi status 0x%x srb status 0x%x\n", 1176 + storvsc_log(device, STORVSC_LOGGING_ERROR, 1177 + "tag#%d cmd 0x%x status: scsi 0x%x srb 0x%x hv 0x%x\n", 1178 + request->cmd->request->tag, 1178 1179 stor_pkt->vm_srb.cdb[0], 1179 1180 vstor_packet->vm_srb.scsi_status, 1180 - vstor_packet->vm_srb.srb_status); 1181 + vstor_packet->vm_srb.srb_status, 1182 + vstor_packet->status); 1181 1183 1182 1184 if (vstor_packet->vm_srb.scsi_status == SAM_STAT_CHECK_CONDITION && 1183 1185 (vstor_packet->vm_srb.srb_status & SRB_STATUS_AUTOSENSE_VALID)) 1184 1186 memcpy(request->cmd->sense_buffer, 1185 1187 vstor_packet->vm_srb.sense_data, 1186 1188 stor_pkt->vm_srb.sense_info_length); 1187 - } 1188 1189 1189 1190 stor_pkt->vm_srb.data_transfer_length = 1190 1191 vstor_packet->vm_srb.data_transfer_length;