[libmultipath] fix empty map flushing
authorChristophe Varoqui <root@xa-s05.(none)>
Fri, 14 Oct 2005 15:17:02 +0000 (17:17 +0200)
committerChristophe Varoqui <root@xa-s05.(none)>
Fri, 14 Oct 2005 15:17:02 +0000 (17:17 +0200)
devmapper.c:dm_flush_map() should flush empty map, whatever the type the
caller asked it to limit to.

Noted by Maxim Kozover

libmultipath/devmapper.c

index ca2d25d..20ecabb 100644 (file)
@@ -253,6 +253,12 @@ out:
        return r;
 }
 
+/*
+ * returns:
+ *    1 : match
+ *    0 : no match
+ *   -1 : empty map
+ */
 extern int
 dm_type(char * name, char * type)
 {
@@ -375,7 +381,7 @@ dm_flush_map (char * mapname, char * type)
        if (!dm_map_present(mapname))
                return 0;
 
-       if (type && dm_type(mapname, type) <= 0)
+       if (!dm_type(mapname, type))
                return 1;
 
        if (dm_remove_partmaps(mapname))