"device-mapper ioctl cmd 12 failed: No such device or address" was
reported upon path add because we tried to submit a device-mapper ioctl
before the map is ready to receive it (and loop till it works or timeout).
shut the libdevmapper for this case with dm_init_log(&dummy_log) during
this operation.
#define MAX_WAIT 5
#define LOOPS_PER_SEC 5
+static void
+dm_dummy_log (int level, const char *file, int line, const char *f, ...)
+{
+ return;
+}
+
+static void
+dm_restore_log (void)
+{
+ dm_log_init(NULL);
+}
+
+static void
+dm_shut_log (void)
+{
+ dm_log_init(&dm_dummy_log);
+}
+
extern int
dm_prereq (char * str, int x, int y, int z)
{
/*
* device map might not be ready when we get here from
- * uevent trigger
+ * daemon uev_trigger -> uev_add_map
*/
while (--loop) {
+ dm_shut_log();
r = dm_task_run(dmt);
+ dm_restore_log();
if (r)
break;
int i;
vector_foreach_slot (vecs->mpvec, mpp, i) {
- if (!dm_map_present(mpp->alias)) {
+ if (mpp && mpp->alias && !dm_map_present(mpp->alias)) {
condlog(2, "%s: remove dead map", mpp->alias);
remove_map(mpp, vecs);
i--;