]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blobdiff - misc/util.c
ext2fs: add multi-mount protection (INCOMPAT_MMP)
[thirdparty/e2fsprogs.git] / misc / util.c
index 4564b4e610ca7920d9a6d605f0b5b233589c4fe0..05334a61d6b004140800a493a65dd649bb3b321f 100644 (file)
@@ -24,6 +24,7 @@
 #ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
+#include <time.h>
 
 #include "et/com_err.h"
 #include "e2p/e2p.h"
@@ -285,3 +286,16 @@ void print_check_message(unsigned int mnt, unsigned int check)
                 "Use tune2fs -c or -i to override.\n"),
               mnt, ((double) check) / (3600 * 24));
 }
+
+void dump_mmp_msg(struct mmp_struct *mmp, const char *msg)
+{
+
+       if (msg)
+               printf("MMP check failed: %s\n", msg);
+       if (mmp) {
+               time_t t = mmp->mmp_time;
+
+               printf("MMP error info: last update: %s node: %s device: %s\n",
+                      ctime(&t), mmp->mmp_nodename, mmp->mmp_bdevname);
+       }
+}