]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - maps.c
clustermd_tests: add test case to test manage_re-add against cluster-raid10
[thirdparty/mdadm.git] / maps.c
diff --git a/maps.c b/maps.c
index 11dd3d20f17203921621113228ab1c0ba93a8d6a..02a047422fb25257e969a74c8bf3a6f51eedb251 100644 (file)
--- a/maps.c
+++ b/maps.c
@@ -137,14 +137,10 @@ mapping_t consistency_policies[] = {
        { "bitmap", CONSISTENCY_POLICY_BITMAP},
        { "journal", CONSISTENCY_POLICY_JOURNAL},
        { "ppl", CONSISTENCY_POLICY_PPL},
-       { NULL, UnSet }
+       { NULL, CONSISTENCY_POLICY_UNKNOWN }
 };
 
 mapping_t sysfs_array_states[] = {
-       /*
-        * Beware map_name() uses strcmp() so active-idle must come before
-        * active, to be detected correctly.
-        */
        { "active-idle", ARRAY_ACTIVE_IDLE },
        { "active", ARRAY_ACTIVE },
        { "clear", ARRAY_CLEAR },
@@ -169,11 +165,8 @@ char *map_num(mapping_t *map, int num)
 
 int map_name(mapping_t *map, char *name)
 {
-       while (map->name) {
-               if (strcmp(map->name, name)==0)
-                       return map->num;
+       while (map->name && strcmp(map->name, name) != 0)
                map++;
-       }
 
        return map->num;
 }