Commit e6c11dbb authored by Maurizio Lombardi's avatar Maurizio Lombardi Committed by Christoph Hellwig

scsi_lib: remove the description string in scsi_io_completion()

During IO with fabric faults, one generally sees several "Unhandled error
code" messages in the syslog as shown below:

sd 4:0:6:2: [sdbw] Unhandled error code
sd 4:0:6:2: [sdbw] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
sd 4:0:6:2: [sdbw] CDB: Read(10): 28 00 00 00 00 00 00 00 08 00
end_request: I/O error, dev sdbw, sector 0

This comes from scsi_io_completion (in scsi_lib.c) while handling error
codes other than DID_RESET or not deferred sense keys i.e. this is
actually handled by the SCSI mid layer. But what gets displayed here is
"Unhandled error code" which is quite misleading as it indicates
something that is not addressed by the mid layer.

The description string is based on the sense key and sometimes on the
additional sense code;
since the ACTION_FAIL case always prints the sense key and the
additional sense code, this patch removes the description string
completely because it does not add useful information.
Signed-off-by: default avatarMaurizio Lombardi <mlombard@redhat.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent cb23f912
...@@ -685,7 +685,6 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) ...@@ -685,7 +685,6 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
int sense_deferred = 0; int sense_deferred = 0;
enum {ACTION_FAIL, ACTION_REPREP, ACTION_RETRY, enum {ACTION_FAIL, ACTION_REPREP, ACTION_RETRY,
ACTION_DELAYED_RETRY} action; ACTION_DELAYED_RETRY} action;
char *description = NULL;
unsigned long wait_for = (cmd->allowed + 1) * req->timeout; unsigned long wait_for = (cmd->allowed + 1) * req->timeout;
if (result) { if (result) {
...@@ -810,7 +809,6 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) ...@@ -810,7 +809,6 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
* and quietly refuse further access. * and quietly refuse further access.
*/ */
cmd->device->changed = 1; cmd->device->changed = 1;
description = "Media Changed";
action = ACTION_FAIL; action = ACTION_FAIL;
} else { } else {
/* Must have been a power glitch, or a /* Must have been a power glitch, or a
...@@ -838,27 +836,10 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) ...@@ -838,27 +836,10 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
cmd->device->use_10_for_rw = 0; cmd->device->use_10_for_rw = 0;
action = ACTION_REPREP; action = ACTION_REPREP;
} else if (sshdr.asc == 0x10) /* DIX */ { } else if (sshdr.asc == 0x10) /* DIX */ {
description = "Host Data Integrity Failure";
action = ACTION_FAIL; action = ACTION_FAIL;
error = -EILSEQ; error = -EILSEQ;
/* INVALID COMMAND OPCODE or INVALID FIELD IN CDB */ /* INVALID COMMAND OPCODE or INVALID FIELD IN CDB */
} else if (sshdr.asc == 0x20 || sshdr.asc == 0x24) { } else if (sshdr.asc == 0x20 || sshdr.asc == 0x24) {
switch (cmd->cmnd[0]) {
case UNMAP:
description = "Discard failure";
break;
case WRITE_SAME:
case WRITE_SAME_16:
if (cmd->cmnd[1] & 0x8)
description = "Discard failure";
else
description =
"Write same failure";
break;
default:
description = "Invalid command failure";
break;
}
action = ACTION_FAIL; action = ACTION_FAIL;
error = -EREMOTEIO; error = -EREMOTEIO;
} else } else
...@@ -866,10 +847,8 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) ...@@ -866,10 +847,8 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
break; break;
case ABORTED_COMMAND: case ABORTED_COMMAND:
action = ACTION_FAIL; action = ACTION_FAIL;
if (sshdr.asc == 0x10) { /* DIF */ if (sshdr.asc == 0x10) /* DIF */
description = "Target Data Integrity Failure";
error = -EILSEQ; error = -EILSEQ;
}
break; break;
case NOT_READY: case NOT_READY:
/* If the device is in the process of becoming /* If the device is in the process of becoming
...@@ -888,42 +867,31 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) ...@@ -888,42 +867,31 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
action = ACTION_DELAYED_RETRY; action = ACTION_DELAYED_RETRY;
break; break;
default: default:
description = "Device not ready";
action = ACTION_FAIL; action = ACTION_FAIL;
break; break;
} }
} else { } else
description = "Device not ready";
action = ACTION_FAIL; action = ACTION_FAIL;
}
break; break;
case VOLUME_OVERFLOW: case VOLUME_OVERFLOW:
/* See SSC3rXX or current. */ /* See SSC3rXX or current. */
action = ACTION_FAIL; action = ACTION_FAIL;
break; break;
default: default:
description = "Unhandled sense code";
action = ACTION_FAIL; action = ACTION_FAIL;
break; break;
} }
} else { } else
description = "Unhandled error code";
action = ACTION_FAIL; action = ACTION_FAIL;
}
if (action != ACTION_FAIL && if (action != ACTION_FAIL &&
time_before(cmd->jiffies_at_alloc + wait_for, jiffies)) { time_before(cmd->jiffies_at_alloc + wait_for, jiffies))
action = ACTION_FAIL; action = ACTION_FAIL;
description = "Command timed out";
}
switch (action) { switch (action) {
case ACTION_FAIL: case ACTION_FAIL:
/* Give up and fail the remainder of the request */ /* Give up and fail the remainder of the request */
if (!(req->cmd_flags & REQ_QUIET)) { if (!(req->cmd_flags & REQ_QUIET)) {
if (description)
scmd_printk(KERN_INFO, cmd, "%s\n",
description);
scsi_print_result(cmd); scsi_print_result(cmd);
if (driver_byte(result) & DRIVER_SENSE) if (driver_byte(result) & DRIVER_SENSE)
scsi_print_sense("", cmd); scsi_print_sense("", cmd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment