libmultipath: disassemble_map: treat minio like assemble_map does
authorMartin Wilck <mwilck@suse.de>
Tue, 28 Feb 2017 16:23:19 +0000 (17:23 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Thu, 23 Mar 2017 08:22:44 +0000 (09:22 +0100)
Rather than using 0 for everything except round-robin, read back
the actual minio value from DM.

Signed-off-by: Martin Wilck <mwilck@suse.com>
libmultipath/dmparser.c

index 4940e8c..469e60d 100644 (file)
@@ -392,19 +392,17 @@ int disassemble_map(vector pathvec, char *params, struct multipath *mpp,
 
                        for (k = 0; k < num_paths_args; k++)
                                if (k == 0) {
 
                        for (k = 0; k < num_paths_args; k++)
                                if (k == 0) {
+                                       p += get_word(p, &word);
+                                       def_minio = atoi(word);
+                                       FREE(word);
+
                                        if (!strncmp(mpp->selector,
                                                     "round-robin", 11)) {
                                        if (!strncmp(mpp->selector,
                                                     "round-robin", 11)) {
-                                               p += get_word(p, &word);
-                                               def_minio = atoi(word);
 
                                                if (mpp->rr_weight == RR_WEIGHT_PRIO
                                                    && pp->priority > 0)
                                                        def_minio /= pp->priority;
 
 
                                                if (mpp->rr_weight == RR_WEIGHT_PRIO
                                                    && pp->priority > 0)
                                                        def_minio /= pp->priority;
 
-                                               FREE(word);
-                                       } else {
-                                               p += get_word(p, NULL);
-                                               def_minio = 0;
                                        }
 
                                        if (def_minio != mpp->minio)
                                        }
 
                                        if (def_minio != mpp->minio)