When arrays do not startup correctly it would be nice to know why. Need
to move the dprintf definition to mdadm.h
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
return (*vers == '/' || *vers == '-');
}
return (*vers == '/' || *vers == '-');
}
+#ifdef DEBUG
+#define dprintf(fmt, arg...) \
+ fprintf(stderr, fmt, ##arg)
+#else
+#define dprintf(fmt, arg...) \
+ ({ if (0) fprintf(stderr, fmt, ##arg); 0; })
+#endif
+
#define LEVEL_MULTIPATH (-4)
#define LEVEL_LINEAR (-1)
#define LEVEL_FAULTY (-5)
#define LEVEL_MULTIPATH (-4)
#define LEVEL_LINEAR (-1)
#define LEVEL_FAULTY (-5)
-#ifdef DEBUG
-#define dprintf(fmt, arg...) \
- fprintf(stderr, fmt, ##arg)
-#else
-#define dprintf(fmt, arg...) \
- ({ if (0) fprintf(stderr, fmt, ##arg); 0; })
-#endif
-
enum array_state { clear, inactive, suspended, readonly, read_auto,
clean, active, write_pending, active_idle, bad_word};
enum array_state { clear, inactive, suspended, readonly, read_auto,
clean, active, write_pending, active_idle, bad_word};
return -1;
n = write(fd, val, strlen(val));
close(fd);
return -1;
n = write(fd, val, strlen(val));
close(fd);
+ if (n != strlen(val)) {
+ dprintf(Name ": failed to write '%s' to '%s' (%s)\n",
+ val, fname, strerror(errno));