[PATCH 14/14] scsi: update scsi_log_completion disposition decoding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Update scsi_log_completion to decode new disposition codes.

Signed-off-by: Mike Christie <michaelc@xxxxxxxxxxx>
Signed-off-by: Mike Anderson <andmike@xxxxxxxxxxxxxxxxxx>
---
 drivers/scsi/scsi.c |   41 ++++++++++++++++++++++-------------------
 include/scsi/scsi.h |    1 +
 2 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index b87fbb2..a4f56af 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -578,37 +578,40 @@ void scsi_log_completion(struct scsi_cmnd *cmd, int disposition)
 	if (unlikely(scsi_logging_level)) {
 		level = SCSI_LOG_LEVEL(SCSI_LOG_MLCOMPLETE_SHIFT,
 				       SCSI_LOG_MLCOMPLETE_BITS);
-		if (((level > 0) && (cmd->result || disposition != SUCCESS)) ||
+		if (((level > 0) &&
+		    (cmd->result || !scsi_disposition_finish(disposition))) ||
 		    (level > 1)) {
 			scmd_printk(KERN_INFO, cmd, "Done: ");
 			if (level > 2)
 				printk("0x%p ", cmd);
+
 			/*
 			 * Dump truncated values, so we usually fit within
 			 * 80 chars.
 			 */
-			switch (disposition) {
-			case SUCCESS:
+			if (scsi_disposition_finish(disposition))
 				printk("SUCCESS\n");
-				break;
-			case NEEDS_RETRY:
+			else if (scsi_disposition_retry(disposition))
 				printk("RETRY\n");
-				break;
-			case ADD_TO_MLQUEUE:
-				printk("MLQUEUE\n");
-				break;
-			case FAILED:
+			else if (scsi_disposition_fail(disposition))
 				printk("FAILED\n");
-				break;
-			case TIMEOUT_ERROR:
-				/* 
-				 * If called via scsi_times_out.
-				 */
-				printk("TIMEOUT\n");
-				break;
-			default:
-				printk("UNKNOWN\n");
+			else {
+				switch (disposition) {
+				case SUCCESS:
+					printk("SUCCESS\n");
+					break;
+				case TIMEOUT_ERROR:
+					/*
+					 * If called via scsi_times_out.
+					 */
+					printk("TIMEOUT\n");
+					break;
+				default:
+					printk("UNKNOWN: 0x%x\n",
+					       disposition);
+				}
 			}
+
 			scsi_print_result(cmd);
 			scsi_print_command(cmd);
 			if (status_byte(cmd->result) & CHECK_CONDITION)
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index cacb12c..c7f317b 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -446,6 +446,7 @@ enum {
 };
 
 #define scsi_disposition_finish(dis) (dis & SCSI_MLQUEUE_DIS_FINISH)
+#define scsi_disposition_fail(dis) (dis & SCSI_MLQUEUE_DIS_FAIL)
 #define scsi_disposition_retry(dis)			\
 	((dis & SCSI_MLQUEUE_DIS_RETRY)		||	\
 	 (dis & SCSI_MLQUEUE_DIS_XPT_RETRY)	||	\
-- 
1.5.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux