Blob Blame History Raw
From: Hannes Reinecke <hare@suse.de>
Date: Wed, 31 Jul 2013 13:34:13 +0200
Subject: dm-mpath: improve logging
References: bnc#708296
Patch-Mainline: Submitted, 06/31/2013 - dm-devel@redhat.com

Add some more instructive logging messages for failures.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/md/dm-mpath.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index 52baf8a..0c20160 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -1223,8 +1223,9 @@ static void pg_init_done(void *data, int errors)
 			errors = 0;
 			break;
 		}
-		DMERR("Could not failover the device: Handler scsi_dh_%s "
-		      "Error %d.", m->hw_handler_name, errors);
+		DMERR("Could not failover device %s: Handler scsi_dh_%s "
+		      "not attached.", pgpath->path.dev->name,
+		      m->hw_handler_name);
 		/*
 		 * Fail path for now, so we do not ping pong
 		 */
@@ -1240,6 +1241,7 @@ static void pg_init_done(void *data, int errors)
 	case SCSI_DH_RETRY:
 		/* Wait before retrying. */
 		delay_retry = 1;
+		DMWARN("Device %s busy, retry.", pgpath->path.dev->name);
 	case SCSI_DH_IMM_RETRY:
 	case SCSI_DH_RES_TEMP_UNAVAIL:
 		if (pg_init_limit_reached(m, pgpath))
@@ -1253,13 +1255,15 @@ static void pg_init_done(void *data, int errors)
 		 * error, but this is what the old dm did. In future
 		 * patches we can do more advanced handling.
 		 */
+		DMERR("Could not failover device %s: Handler scsi_dh_%s "
+		      "error %d.", pgpath->path.dev->name,
+		      m->hw_handler_name, errors);
 		fail_path(pgpath);
 	}
 
 	spin_lock_irqsave(&m->lock, flags);
 	if (errors) {
 		if (pgpath == m->current_pgpath) {
-			DMERR("Could not failover device. Error %d.", errors);
 			m->current_pgpath = NULL;
 			m->current_pg = NULL;
 		}
-- 
1.8.5.6