From: Mike Snitzer <snitzer@redhat.com> Date: Tue, 8 Feb 2011 18:49:06 -0500 Subject: [md] dm-mpath: skip activate_path for failed paths Message-id: <1297190949-29149-7-git-send-email-snitzer@redhat.com> Patchwork-id: 33171 O-Subject: [RHEL5.7 PATCH 5/8] dm mpath: skip activate_path for failed paths Bugzilla: 673058 RH-Acked-by: Alasdair G Kergon <agk@redhat.com> BZ 673058 Upstream commit f7b934c8127deebf4eb56fbe4a4ae0da16b6dbcd Author: Moger, Babu <Babu.Moger@lsi.com> Date: Sat Mar 6 02:29:49 2010 +0000 dm mpath: skip activate_path for failed paths This patch adds two minor fixes while processing device mapper path activation. Skip failed paths while calling activate_path. If the path is already failed then activate_path will fail for sure. We don't have to call in that case. In some case this might cause prolonged retries unnecessarily. Change the misleading message if the path being activated fails with SCSI_DH_NOSYS. Signed-off-by: Babu Moger <babu.moger@lsi.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index c49bc0e..4de9a33 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -449,6 +449,9 @@ static void process_queued_ios(void *data) init_required = 1; } else { list_for_each_entry(tmp, &pgpath->pg->pgpaths, list) { + /* Skip failed paths */ + if (!tmp->path.is_active) + continue; if (queue_delayed_work(kmpath_handlerd, &tmp->activate_path, m->pg_init_delay ? m->pg_init_delay_secs * HZ : 0)) @@ -1199,8 +1202,8 @@ static void pg_init_done(void *data, int errors) errors = 0; break; } - DMERR("Cannot failover device because scsi_dh_%s was not " - "loaded.", m->hw_handler_name); + DMERR("Could not failover the device: Handler scsi_dh_%s " + "Error %d.", m->hw_handler_name, errors); /* * Fail path for now, so we do not ping pong */