multipath: check setup_multipath return value.
authorBenjamin Marzinski <bmarzins@redhat.com>
Wed, 13 Jul 2011 18:30:42 +0000 (13:30 -0500)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Thu, 1 Sep 2011 06:58:32 +0000 (08:58 +0200)
When setup_multipath() fails, it removes the map. So update_path_groups()
needs check the return value, and fail without touching the map anymore if
setup_multipath() fails.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
multipathd/main.c

index be236cb..68ce749 100644 (file)
@@ -1060,7 +1060,8 @@ int update_path_groups(struct multipath *mpp, struct vectors *vecs, int refresh)
                return 1;
        }
        dm_lib_release();
-       setup_multipath(vecs, mpp);
+       if (setup_multipath(vecs, mpp) != 0)
+               return 1;
        sync_map_state(mpp);
 
        return 0;