libmultipath: correct path count in setup_map()
authorHannes Reinecke <hare@suse.de>
Fri, 18 Feb 2011 07:25:59 +0000 (08:25 +0100)
committerHannes Reinecke <hare@suse.de>
Tue, 3 May 2011 11:45:22 +0000 (13:45 +0200)
We should be counting both, UP and GHOST paths when counting the
number of available paths. Otherwise the count might become
negative and multipath would never switch into recovery mode.

References: bz#677821

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath/configure.c

index 048fdd7..d512a1a 100644 (file)
@@ -88,7 +88,7 @@ setup_map (struct multipath * mpp, char * params, int params_size)
        if (mpp->pgpolicyfn && mpp->pgpolicyfn(mpp))
                return 1;
 
-       mpp->nr_active = pathcount(mpp, PATH_UP);
+       mpp->nr_active = pathcount(mpp, PATH_UP) + pathcount(mpp, PATH_GHOST);
 
        /*
         * ponders each path group and determine highest prio pg