linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: replace numeric messages with string error messages when blk_execute_rq fails.  Also add printing of sense info.
@ 2014-04-22 11:44 Maurizio Lombardi
  2014-04-25 13:12 ` Christoph Hellwig
  0 siblings, 1 reply; 12+ messages in thread
From: Maurizio Lombardi @ 2014-04-22 11:44 UTC (permalink / raw)
  To: linux-scsi; +Cc: JBottomley, hch

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
---
 drivers/scsi/device_handler/scsi_dh_alua.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
index 5248c88..1903ae5 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -25,6 +25,7 @@
 #include <scsi/scsi.h>
 #include <scsi/scsi_eh.h>
 #include <scsi/scsi_dh.h>
+#include <scsi/scsi_dbg.h>
 
 #define ALUA_DH_NAME "alua"
 #define ALUA_DH_VER "1.3"
@@ -163,9 +164,12 @@ static int submit_vpd_inquiry(struct scsi_device *sdev, struct alua_dh_data *h)
 
 	err = blk_execute_rq(rq->q, NULL, rq, 1);
 	if (err == -EIO) {
-		sdev_printk(KERN_INFO, sdev,
-			    "%s: evpd inquiry failed with %x\n",
-			    ALUA_DH_NAME, rq->errors);
+		sdev_printk(KERN_INFO, sdev, "%s: evpd inquiry failed\n",
+			    ALUA_DH_NAME);
+		scsi_show_result(rq->errors);
+		if (driver_byte(rq->errors) & DRIVER_SENSE)
+			__scsi_print_sense("alua vpd_inquiry", rq->sense,
+					   rq->sense_len);
 		h->senselen = rq->sense_len;
 		err = SCSI_DH_IO;
 	}
@@ -206,9 +210,11 @@ static unsigned submit_rtpg(struct scsi_device *sdev, struct alua_dh_data *h,
 
 	err = blk_execute_rq(rq->q, NULL, rq, 1);
 	if (err == -EIO) {
-		sdev_printk(KERN_INFO, sdev,
-			    "%s: rtpg failed with %x\n",
-			    ALUA_DH_NAME, rq->errors);
+		sdev_printk(KERN_INFO, sdev, "%s: rtpg failed\n", ALUA_DH_NAME);
+		scsi_show_result(rq->errors);
+		if (driver_byte(rq->errors) & DRIVER_SENSE)
+			__scsi_print_sense("alua submit_rtpg", rq->sense,
+					   rq->sense_len);
 		h->senselen = rq->sense_len;
 		err = SCSI_DH_IO;
 	}
-- 
Maurizio Lombardi


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-06-04  7:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-22 11:44 [PATCH] scsi: replace numeric messages with string error messages when blk_execute_rq fails. Also add printing of sense info Maurizio Lombardi
2014-04-25 13:12 ` Christoph Hellwig
2014-04-25 15:40   ` Maurizio Lombardi
2014-04-29  9:30   ` Maurizio Lombardi
2014-04-29 18:00     ` Christoph Hellwig
2014-05-13 13:10       ` Maurizio Lombardi
2014-05-13 14:07         ` Christoph Hellwig
2014-05-13 14:14           ` Hannes Reinecke
2014-05-13 14:24             ` Maurizio Lombardi
2014-05-15  6:41               ` Christoph Hellwig
2014-06-04  7:51                 ` Maurizio Lombardi
2014-06-04  7:53                   ` Hannes Reinecke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).