[libmultipath] devmap status parser fix
authorChristophe Varoqui <root@xa-s05.(none)>
Sun, 2 Oct 2005 12:05:42 +0000 (14:05 +0200)
committerChristophe Varoqui <root@xa-s05.(none)>
Sun, 2 Oct 2005 12:05:42 +0000 (14:05 +0200)
The status information from path selectors that apply to paths are
repeated for each path. Current code assumed this info appears
only once per path group.

Stefan Bader, IBM

libmultipath/dmparser.c

index 59e32fdae59a6865530ca8c42e63fcef0f787aed..71deb08944abd005843902fe2795ba18adbfa82b 100644 (file)
@@ -250,7 +250,7 @@ disassemble_status (char * params, struct multipath * mpp)
 {
        char * word;
        char * p;
-       int i, j;
+       int i, j, k;
        int num_feature_args;
        int num_hwhandler_args;
        int num_pg;
@@ -405,12 +405,13 @@ disassemble_status (char * params, struct multipath * mpp)
 
                        pp->failcount = atoi(word);
                        FREE(word);
+
+                       /*
+                        * selector args
+                        */
+                       for (k = 0; k < num_pg_args; k++)
+                               p += get_word(p, NULL);
                }
-               /*
-                * selector args
-                */
-               for (j = 0; j < num_pg_args; j++)
-                       p += get_word(p, NULL);
        }
        return 0;
 }