diff mbox

[44/57] multipathd: Do not switch paths on empty multipath tables

Message ID 1461755458-29225-45-git-send-email-hare@suse.de (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Hannes Reinecke April 27, 2016, 11:10 a.m. UTC
If all paths are removed from a multipath table there is no
point in trying to switch path groups as we don't have any.

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 multipathd/main.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/multipathd/main.c b/multipathd/main.c
index ebb9a50..a86530f 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -126,6 +126,9 @@  need_switch_pathgroup (struct multipath * mpp, int refresh)
 			vector_foreach_slot (pgp->paths, pp, j)
 				pathinfo(pp, conf->hwtable, DI_PRIO);
 
+	if (!mpp->pg || VECTOR_SIZE(mpp->paths) == 0)
+		return 0;
+
 	mpp->bestpg = select_path_group(mpp);
 
 	if (mpp->bestpg != mpp->nextpg)