multipath: better check for daemon mode
authorBenjamin Marzinski <bmarzins@redhat.com>
Tue, 11 Oct 2011 03:16:51 +0000 (22:16 -0500)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Tue, 11 Oct 2011 04:47:51 +0000 (06:47 +0200)
With the existing check, if a multipath device gets created with a
blacklisted path (because, for instance, the path was unblacklisted,
but multipathd was not reconfigured), multipathd will crash.  This is
because multipathd will add the path when it adds the multipath device,
but it won't have all the necessary information to use the path. The
new check makes sure multipathd won't add blacklisted paths, simply
because they are part of a multipath device.

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

index d4eee9a262d962100471f5d26f4203076f6a9d0f..5848ec5bcbe0690b1022dee0226bb21ec0b00814 100644 (file)
@@ -13,6 +13,7 @@
 #include "structs.h"
 #include "util.h"
 #include "debug.h"
+#include "config.h"
 
 #define WORD_SIZE 64
 
@@ -330,7 +331,7 @@ disassemble_map (vector pathvec, char * params, struct multipath * mpp)
                                strncpy(pp->dev_t, word, BLK_DEV_SIZE);
 
                                /* Only call this in multipath client mode */
-                               if (!mpp->waiter && store_path(pathvec, pp))
+                               if (!conf->daemon && store_path(pathvec, pp))
                                        goto out1;
                        }
                        FREE(word);