multipath: fix setting conf->version
authorBenjamin Marzinski <bmarzins@redhat.com>
Wed, 1 Aug 2018 20:56:49 +0000 (15:56 -0500)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Tue, 7 Aug 2018 13:30:07 +0000 (15:30 +0200)
Commit d3b71498 stopped multipath from setting conf->version. Instead,
it was always being set to 0.0.0. Multipathd was still setting this
correctly.

Fixes: d3b71498 "multipath: fix rcu thread cancellation hang"
Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
libmultipath/devmapper.c

index f2befad..8136d15 100644 (file)
@@ -245,13 +245,13 @@ void libmp_dm_init(void)
        int verbosity;
        unsigned int version[3];
 
+       if (dm_prereq(version))
+               exit(1);
        conf = get_multipath_config();
        verbosity = conf->verbosity;
-       memcpy(version, conf->version, sizeof(version));
+       memcpy(conf->version, version, sizeof(version));
        put_multipath_config(conf);
        dm_init(verbosity);
-       if (dm_prereq(version))
-               exit(1);
        dm_udev_set_sync_support(libmp_dm_udev_sync);
 }