Whamcloud - gitweb
Fix compile error and warnings for old gcc versions
[tools/e2fsprogs.git] / debugfs / set_fields.c
index 1d5d630..e1e23a5 100644 (file)
@@ -30,6 +30,7 @@
 #ifdef HAVE_ERRNO_H
 #include <errno.h>
 #endif
+#include <assert.h>
 #if HAVE_STRINGS_H
 #include <strings.h>
 #endif
 #include "debugfs.h"
 #include "uuid/uuid.h"
 #include "e2p/e2p.h"
+#include "support/quotaio.h"
 
 static struct ext2_super_block set_sb;
 static struct ext2_inode_large set_inode;
 static struct ext2_group_desc set_gd;
 static struct ext4_group_desc set_gd4;
+static struct mmp_struct set_mmp;
 static dgrp_t set_bg;
 static ext2_ino_t set_ino;
 static int array_idx;
 
 #define FLAG_ARRAY     0x0001
+#define FLAG_ALIAS     0x0002  /* Data intersects with other field */
 
 struct field_set_info {
        const char      *name;
@@ -68,6 +72,13 @@ static errcode_t parse_hashalg(struct field_set_info *info, char *field, char *a
 static errcode_t parse_time(struct field_set_info *info, char *field, char *arg);
 static errcode_t parse_bmap(struct field_set_info *info, char *field, char *arg);
 static errcode_t parse_gd_csum(struct field_set_info *info, char *field, char *arg);
+static errcode_t parse_mmp_clear(struct field_set_info *info, char *field,
+                                char *arg);
+
+#if __GNUC_PREREQ (4, 6)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#endif
 
 static struct field_set_info super_fields[] = {
        { "inodes_count", &set_sb.s_inodes_count, NULL, 4, parse_uint },
@@ -107,7 +118,6 @@ static struct field_set_info super_fields[] = {
        { "uuid", &set_sb.s_uuid, NULL, 16, parse_uuid },
        { "volume_name",  &set_sb.s_volume_name, NULL, 16, parse_string },
        { "last_mounted",  &set_sb.s_last_mounted, NULL, 64, parse_string },
-       { "lastcheck",  &set_sb.s_lastcheck, NULL, 4, parse_uint },
        { "algorithm_usage_bitmap", &set_sb.s_algorithm_usage_bitmap, NULL,
                  4, parse_uint },
        { "prealloc_blocks", &set_sb.s_prealloc_blocks, NULL, 1, parse_uint },
@@ -132,8 +142,7 @@ static struct field_set_info super_fields[] = {
        { "want_extra_isize", &set_sb.s_want_extra_isize, NULL, 2, parse_uint },
        { "flags", &set_sb.s_flags, NULL, 4, parse_uint },
        { "raid_stride", &set_sb.s_raid_stride, NULL, 2, parse_uint },
-       { "min_extra_isize", &set_sb.s_min_extra_isize, NULL, 4, parse_uint },
-       { "mmp_interval", &set_sb.s_mmp_interval, NULL, 2, parse_uint },
+       { "mmp_interval", &set_sb.s_mmp_update_interval, NULL, 2, parse_uint },
        { "mmp_block", &set_sb.s_mmp_block, NULL, 8, parse_uint },
        { "raid_stripe_width", &set_sb.s_raid_stripe_width, NULL, 4, parse_uint },
        { "log_groups_per_flex", &set_sb.s_log_groups_per_flex, NULL, 1, parse_uint },
@@ -146,21 +155,45 @@ static struct field_set_info super_fields[] = {
        { "mount_opts",  &set_sb.s_mount_opts, NULL, 64, parse_string },
        { "usr_quota_inum", &set_sb.s_usr_quota_inum, NULL, 4, parse_uint },
        { "grp_quota_inum", &set_sb.s_grp_quota_inum, NULL, 4, parse_uint },
+       { "prj_quota_inum", &set_sb.s_prj_quota_inum, NULL, 4, parse_uint },
        { "overhead_blocks", &set_sb.s_overhead_blocks, NULL, 4, parse_uint },
+       { "backup_bgs", &set_sb.s_backup_bgs[0], NULL, 4, parse_uint,
+         FLAG_ARRAY, 2 },
        { "checksum", &set_sb.s_checksum, NULL, 4, parse_uint },
+       { "checksum_type", &set_sb.s_checksum_type, NULL, 1, parse_uint },
+       { "encryption_level", &set_sb.s_encryption_level, NULL, 1, parse_uint },
+       { "error_count", &set_sb.s_error_count, NULL, 4, parse_uint },
+       { "first_error_time", &set_sb.s_first_error_time, NULL, 4, parse_time },
+       { "first_error_ino", &set_sb.s_first_error_ino, NULL, 4, parse_uint },
+       { "first_error_block", &set_sb.s_first_error_block, NULL, 8, parse_uint },
+       { "first_error_func", &set_sb.s_first_error_func, NULL, 32, parse_string },
+       { "first_error_line", &set_sb.s_first_error_line, NULL, 4, parse_uint },
+       { "last_error_time", &set_sb.s_last_error_time, NULL, 4, parse_time },
+       { "last_error_ino", &set_sb.s_last_error_ino, NULL, 4, parse_uint },
+       { "last_error_block", &set_sb.s_last_error_block, NULL, 8, parse_uint },
+       { "last_error_func", &set_sb.s_last_error_func, NULL, 32, parse_string },
+       { "last_error_line", &set_sb.s_last_error_line, NULL, 4, parse_uint },
+       { "encrypt_algos", &set_sb.s_encrypt_algos, NULL, 1, parse_uint,
+         FLAG_ARRAY, 4 },
+       { "encrypt_pw_salt", &set_sb.s_encrypt_pw_salt, NULL, 16, parse_uuid },
+       { "lpf_ino", &set_sb.s_lpf_ino, NULL, 4, parse_uint },
+       { "checksum_seed", &set_sb.s_checksum_seed, NULL, 4, parse_uint },
        { 0, 0, 0, 0 }
 };
 
 static struct field_set_info inode_fields[] = {
-       { "inodes_count", &set_sb.s_inodes_count, NULL, 4, parse_uint },
        { "mode", &set_inode.i_mode, NULL, 2, parse_uint },
        { "uid", &set_inode.i_uid, &set_inode.osd2.linux2.l_i_uid_high,
                2, parse_uint },
        { "size", &set_inode.i_size, &set_inode.i_size_high, 4, parse_uint },
-       { "atime", &set_inode.i_atime, NULL, 4, parse_time },
-       { "ctime", &set_inode.i_ctime, NULL, 4, parse_time },
-       { "mtime", &set_inode.i_mtime, NULL, 4, parse_time },
-       { "dtime", &set_inode.i_dtime, NULL, 4, parse_time },
+       { "atime", &set_inode.i_atime, &set_inode.i_atime_extra,
+               4, parse_time },
+       { "ctime", &set_inode.i_ctime, &set_inode.i_ctime_extra,
+               4, parse_time },
+       { "mtime", &set_inode.i_mtime, &set_inode.i_mtime_extra,
+               4, parse_time },
+       { "dtime", &set_inode.i_dtime, NULL,
+               4, parse_time },
        { "gid", &set_inode.i_gid, &set_inode.osd2.linux2.l_i_gid_high,
                2, parse_uint },
        { "links_count", &set_inode.i_links_count, NULL, 2, parse_uint },
@@ -170,7 +203,8 @@ static struct field_set_info inode_fields[] = {
        { "flags", &set_inode.i_flags, NULL, 4, parse_uint },
        { "version", &set_inode.osd1.linux1.l_i_version,
                &set_inode.i_version_hi, 4, parse_uint },
-       { "translator", &set_inode.osd1.hurd1.h_i_translator, NULL, 4, parse_uint },
+       { "translator", &set_inode.osd1.hurd1.h_i_translator, NULL,
+               4, parse_uint, FLAG_ALIAS },
        { "block", &set_inode.i_block[0], NULL, 4, parse_uint, FLAG_ARRAY,
          EXT2_NDIR_BLOCKS },
        { "block[IND]", &set_inode.i_block[EXT2_IND_BLOCK], NULL, 4, parse_uint },
@@ -180,25 +214,26 @@ static struct field_set_info inode_fields[] = {
        /* Special case: i_file_acl_high is 2 bytes */
        { "file_acl", &set_inode.i_file_acl, 
                &set_inode.osd2.linux2.l_i_file_acl_high, 6, parse_uint },
-       { "dir_acl", &set_inode.i_dir_acl, NULL, 4, parse_uint },
        { "faddr", &set_inode.i_faddr, NULL, 4, parse_uint },
-       { "frag", &set_inode.osd2.hurd2.h_i_frag, NULL, 1, parse_uint },
+       { "frag", &set_inode.osd2.hurd2.h_i_frag, NULL, 1, parse_uint, FLAG_ALIAS },
        { "fsize", &set_inode.osd2.hurd2.h_i_fsize, NULL, 1, parse_uint },
        { "checksum", &set_inode.osd2.linux2.l_i_checksum_lo, 
                &set_inode.i_checksum_hi, 2, parse_uint },
        { "author", &set_inode.osd2.hurd2.h_i_author, NULL,
-               4, parse_uint },
+               4, parse_uint, FLAG_ALIAS },
        { "extra_isize", &set_inode.i_extra_isize, NULL,
                2, parse_uint },
        { "ctime_extra", &set_inode.i_ctime_extra, NULL,
-               4, parse_uint },
+               4, parse_uint, FLAG_ALIAS },
        { "mtime_extra", &set_inode.i_mtime_extra, NULL,
-               4, parse_uint },
+               4, parse_uint, FLAG_ALIAS  },
        { "atime_extra", &set_inode.i_atime_extra, NULL,
-               4, parse_uint },
-       { "crtime", &set_inode.i_crtime, NULL, 4, parse_uint },
+               4, parse_uint, FLAG_ALIAS },
+       { "crtime", &set_inode.i_crtime, &set_inode.i_crtime_extra,
+               4, parse_time },
        { "crtime_extra", &set_inode.i_crtime_extra, NULL,
-               4, parse_uint },
+               4, parse_uint, FLAG_ALIAS },
+       { "projid", &set_inode.i_projid, NULL, 4, parse_uint },
        { "bmap", NULL, NULL, 4, parse_bmap, FLAG_ARRAY },
        { 0, 0, 0, 0 }
 };
@@ -242,6 +277,76 @@ static struct field_set_info ext4_bg_fields[] = {
        { 0, 0, 0, 0 }
 };
 
+static struct field_set_info mmp_fields[] = {
+       { "clear", &set_mmp.mmp_magic, NULL, sizeof(set_mmp),
+               parse_mmp_clear, FLAG_ALIAS },
+       { "magic", &set_mmp.mmp_magic, NULL, 4, parse_uint },
+       { "seq", &set_mmp.mmp_seq, NULL, 4, parse_uint },
+       { "time", &set_mmp.mmp_time, NULL, 8, parse_uint },
+       { "nodename", &set_mmp.mmp_nodename, NULL, sizeof(set_mmp.mmp_nodename),
+               parse_string },
+       { "bdevname", &set_mmp.mmp_bdevname, NULL, sizeof(set_mmp.mmp_bdevname),
+               parse_string },
+       { "check_interval", &set_mmp.mmp_check_interval, NULL, 2, parse_uint },
+       { "checksum", &set_mmp.mmp_checksum, NULL, 4, parse_uint },
+       { 0, 0, 0, 0 }
+};
+#if __GNUC_PREREQ (4, 6)
+#pragma GCC diagnostic pop
+#endif
+
+#ifdef UNITTEST
+
+
+static void do_verify_field_set_info(struct field_set_info *fields,
+               const void *data, size_t size)
+{
+       struct field_set_info *ss, *ss2;
+       const char *begin = (char *)data;
+       const char *end = begin + size;
+
+       for (ss = fields ; ss->name ; ss++) {
+               const char *ptr;
+
+               /* Check pointers */
+               ptr = ss->ptr;
+               assert(!ptr || (ptr >= begin && ptr < end));
+               ptr = ss->ptr2;
+               assert(!ptr || (ptr >= begin && ptr < end));
+
+               /* Check function */
+               assert(ss->func);
+
+               for (ss2 = fields ; ss2 != ss ; ss2++) {
+                       /* Check duplicate names */
+                       assert(strcmp(ss->name, ss2->name));
+
+                       if (ss->flags & FLAG_ALIAS || ss2->flags & FLAG_ALIAS)
+                               continue;
+                       /* Check false aliases, might be copy-n-paste error */
+                       assert(!ss->ptr || (ss->ptr != ss2->ptr &&
+                                           ss->ptr != ss2->ptr2));
+                       assert(!ss->ptr2 || (ss->ptr2 != ss2->ptr &&
+                                            ss->ptr2 != ss2->ptr2));
+               }
+       }
+}
+
+int main(int argc, char **argv)
+{
+       do_verify_field_set_info(super_fields, &set_sb, sizeof(set_sb));
+       do_verify_field_set_info(inode_fields, &set_inode, sizeof(set_inode));
+       do_verify_field_set_info(ext2_bg_fields, &set_gd, sizeof(set_gd));
+       do_verify_field_set_info(ext4_bg_fields, &set_gd4, sizeof(set_gd4));
+       do_verify_field_set_info(mmp_fields, &set_mmp, sizeof(set_mmp));
+       return 0;
+}
+
+ext2_filsys current_fs;
+ext2_ino_t root, cwd;
+
+#endif /* UNITTEST */
+
 static int check_suffix(const char *field)
 {
        int len = strlen(field);
@@ -293,8 +398,11 @@ static struct field_set_info *find_field(struct field_set_info *fields,
         */
        if (idx) {
                array_idx = strtol(idx, &tmp, 0);
-               if (*tmp)
+               if (*tmp) {
+                       *(--idx) = '[';
+                       *delim = ']';
                        idx = 0;
+               }
        }
 
        /*
@@ -325,7 +433,7 @@ static struct field_set_info *find_field(struct field_set_info *fields,
 
 /*
  * Note: info->size == 6 is special; this means a base size 4 bytes,
- * and secondiory (high) size of 2 bytes.  This is needed for the
+ * and secondary (high) size of 2 bytes.  This is needed for the
  * special case of i_blocks_high and i_file_acl_high.
  */
 static errcode_t parse_uint(struct field_set_info *info, char *field,
@@ -374,7 +482,10 @@ static errcode_t parse_uint(struct field_set_info *info, char *field,
        n = num & mask;
        switch (size) {
        case 8:
-               *u.ptr64 = n;
+               /* Should never get here */
+               fprintf(stderr, "64-bit field %s has a second 64-bit field\n"
+                       "defined; BUG?!?\n", info->name);
+               *u.ptr64 = 0;
                break;
        case 4:
                *u.ptr32 = n;
@@ -388,7 +499,7 @@ static errcode_t parse_uint(struct field_set_info *info, char *field,
        }
        if (!field2)
                return 0;
-       n = num >> (size*8);
+       n = (size == 8) ? 0 : (num >> (size*8));
        u.ptr8 = (__u8 *) field2;
        if (info->size == 6)
                size = 2;
@@ -409,7 +520,8 @@ static errcode_t parse_uint(struct field_set_info *info, char *field,
        return 0;
 }
 
-static errcode_t parse_int(struct field_set_info *info, char *field, char *arg)
+static errcode_t parse_int(struct field_set_info *info,
+                          char *field EXT2FS_ATTR((unused)), char *arg)
 {
        long    num;
        char *tmp;
@@ -440,8 +552,8 @@ static errcode_t parse_int(struct field_set_info *info, char *field, char *arg)
        return 0;
 }
 
-static errcode_t parse_string(struct field_set_info *info, char *field,
-                             char *arg)
+static errcode_t parse_string(struct field_set_info *info,
+                             char *field EXT2FS_ATTR((unused)), char *arg)
 {
        char    *cp = (char *) info->ptr;
 
@@ -454,25 +566,36 @@ static errcode_t parse_string(struct field_set_info *info, char *field,
        return 0;
 }
 
-static errcode_t parse_time(struct field_set_info *info, char *field, char *arg)
+static errcode_t parse_time(struct field_set_info *info,
+                           char *field, char *arg)
 {
-       time_t          t;
-       __u32           *ptr32;
+       __s64           t;
+       __u32           t_low, t_high;
+       __u32           *ptr_low, *ptr_high;
 
-       ptr32 = (__u32 *) info->ptr;
+       if (check_suffix(field))
+               return parse_uint(info, field, arg);
+
+       ptr_low  = (__u32 *) info->ptr;
+       ptr_high = (__u32 *) info->ptr2;
 
        t = string_to_time(arg);
 
-       if (t == ((time_t) -1)) {
+       if (t == -1) {
                fprintf(stderr, "Couldn't parse '%s' for field %s.\n",
                        arg, info->name);
                return EINVAL;
        }
-       *ptr32 = t;
+       t_low = (__u32) t;
+       t_high = ((t - (__s32)t) >> 32) & EXT4_EPOCH_MASK;
+       *ptr_low = t_low;
+       if (ptr_high)
+               *ptr_high = (*ptr_high & ~EXT4_EPOCH_MASK) | t_high;
        return 0;
 }
 
-static errcode_t parse_uuid(struct field_set_info *info, char *field, char *arg)
+static errcode_t parse_uuid(struct field_set_info *info,
+                           char *field EXT2FS_ATTR((unused)), char *arg)
 {
        unsigned char * p = (unsigned char *) info->ptr;
 
@@ -490,8 +613,8 @@ static errcode_t parse_uuid(struct field_set_info *info, char *field, char *arg)
        return 0;
 }
 
-static errcode_t parse_hashalg(struct field_set_info *info, char *field,
-                              char *arg)
+static errcode_t parse_hashalg(struct field_set_info *info,
+                              char *field EXT2FS_ATTR((unused)), char *arg)
 {
        int     hashv;
        unsigned char   *p = (unsigned char *) info->ptr;
@@ -505,25 +628,24 @@ static errcode_t parse_hashalg(struct field_set_info *info, char *field,
        return 0;
 }
 
-static errcode_t parse_bmap(struct field_set_info *info, char *field,
-                           char *arg)
+static errcode_t parse_bmap(struct field_set_info *info,
+                           char *field EXT2FS_ATTR((unused)), char *arg)
 {
-       unsigned long   num;
-       blk_t           blk;
+       blk64_t         blk;
        errcode_t       retval;
        char            *tmp;
 
-       num = strtoul(arg, &tmp, 0);
+       blk = strtoull(arg, &tmp, 0);
        if (*tmp) {
                fprintf(stderr, "Couldn't parse '%s' for field %s.\n",
                        arg, info->name);
                return EINVAL;
        }
-       blk = num;
 
-       retval = ext2fs_bmap(current_fs, set_ino,
-                            (struct ext2_inode *) &set_inode,
-                            0, BMAP_SET, array_idx, &blk);
+       retval = ext2fs_bmap2(current_fs, set_ino,
+                             (struct ext2_inode *) &set_inode,
+                             NULL, BMAP_ALLOC | BMAP_SET, array_idx, NULL,
+                             &blk);
        if (retval) {
                com_err("set_inode", retval, "while setting block map");
        }
@@ -533,18 +655,13 @@ static errcode_t parse_bmap(struct field_set_info *info, char *field,
 static errcode_t parse_gd_csum(struct field_set_info *info, char *field,
                               char *arg)
 {
+       __u16 *checksum = info->ptr;
 
        if (strcmp(arg, "calc") == 0) {
-               ext2fs_group_desc_csum_set(current_fs, set_bg);
-               memcpy(&set_gd, ext2fs_group_desc(current_fs,
-                                       current_fs->group_desc,
-                                       set_bg),
-                       sizeof(set_gd));
-               printf("Checksum set to 0x%04x\n",
-                      ext2fs_bg_checksum(current_fs, set_bg));
+               *checksum = ext2fs_group_desc_csum(current_fs, set_bg);
+               printf("Checksum set to 0x%04x\n", *checksum);
                return 0;
        }
-
        return parse_uint(info, field, arg);
 }
 
@@ -561,6 +678,9 @@ static void print_possible_fields(struct field_set_info *fields)
        } else if (fields == inode_fields) {
                type = "Inode";
                cmd = "set_inode";
+       } else if (fields == mmp_fields) {
+               type = "MMP";
+               cmd = "set_mmp_value";
        } else {
                type = "Block group descriptor";
                cmd = "set_block_group";
@@ -671,7 +791,7 @@ void do_set_inode(int argc, char *argv[])
 void do_set_block_group_descriptor(int argc, char *argv[])
 {
        const char *usage = "<bg number> <field> <value>\n"
-               "\t\"set_block_group_descriptor -l\" will list the names of "
+               "\t\"set_block_group -l\" will list the names of "
                "the fields in a block group descriptor\n\twhich can be set.";
        struct field_set_info   *table;
        struct field_set_info   *ss;
@@ -680,11 +800,14 @@ void do_set_block_group_descriptor(int argc, char *argv[])
        int                     size;
 
        /*
-        *Determine whether we are editing an ext2 or ext4 block
-        * group descriptor
+        * Determine whether we are editing an ext2 or ext4 block group
+        * descriptor.  Descriptors larger than ext4_group_desc cannot
+        * have their fields edited yet, because they do not have any
+        * names assigned.  When that happens, this function needs to
+        * be updated for the new descriptor struct and fields.
         */
-       if (current_fs && current_fs->super->s_feature_incompat &
-           EXT4_FEATURE_INCOMPAT_64BIT) {
+       if (current_fs &&
+           EXT2_DESC_SIZE(current_fs->super) >= EXT2_MIN_DESC_SIZE_64BIT) {
                table = ext4_bg_fields;
                edit = &set_gd4;
                size = sizeof(set_gd4);
@@ -699,7 +822,7 @@ void do_set_block_group_descriptor(int argc, char *argv[])
                return;
        }
 
-       if (common_args_process(argc, argv, 4, 4, "set_block_group_descriptor",
+       if (common_args_process(argc, argv, 4, 4, "set_block_group",
                                usage, CHECK_FS_RW))
                return;
 
@@ -726,3 +849,86 @@ void do_set_block_group_descriptor(int argc, char *argv[])
                ext2fs_mark_super_dirty(current_fs);
        }
 }
+
+static errcode_t parse_mmp_clear(struct field_set_info *info,
+                                char *field EXT2FS_ATTR((unused)),
+                                char *arg EXT2FS_ATTR((unused)))
+{
+       errcode_t retval;
+
+       retval = ext2fs_mmp_clear(current_fs);
+       if (retval != 0)
+               com_err("set_mmp_value", retval, "while clearing MMP block\n");
+       else
+               memcpy(info->ptr, current_fs->mmp_buf, info->size);
+
+       return 1; /* we don't need the MMP block written again */
+}
+
+#ifdef CONFIG_MMP
+void do_set_mmp_value(int argc, char *argv[])
+{
+       const char *usage = "<field> <value>\n"
+               "\t\"set_mmp_value -l\" will list the names of "
+               "MMP fields\n\twhich can be set.";
+       static struct field_set_info *smmp;
+       struct mmp_struct *mmp_s;
+       errcode_t retval;
+
+       if (argc == 2 && strcmp(argv[1], "-l") == 0) {
+               print_possible_fields(mmp_fields);
+               return;
+       }
+
+       if (check_fs_open(argv[0]))
+               return;
+
+       if (current_fs->super->s_mmp_block == 0) {
+               com_err(argv[0], 0, "no MMP block allocated\n");
+               return;
+       }
+
+       if (common_args_process(argc, argv, 2, 3, "set_mmp_value",
+                               usage, CHECK_FS_RW))
+               return;
+
+       mmp_s = current_fs->mmp_buf;
+       if (mmp_s == NULL) {
+               retval = ext2fs_get_mem(current_fs->blocksize, &mmp_s);
+               if (retval) {
+                       com_err(argv[0], retval, "allocating MMP buffer\n");
+                       return;
+               }
+               retval = ext2fs_mmp_read(current_fs,
+                                        current_fs->super->s_mmp_block, mmp_s);
+               if (retval) {
+                       com_err(argv[0], retval, "reading MMP block %llu.\n",
+                               (long long)current_fs->super->s_mmp_block);
+                       ext2fs_free_mem(&mmp_s);
+                       return;
+               }
+               current_fs->mmp_buf = mmp_s;
+       }
+
+       smmp = find_field(mmp_fields, argv[1]);
+       if (smmp == 0) {
+               com_err(argv[0], 0, "invalid field specifier: %s", argv[1]);
+               return;
+       }
+
+       set_mmp = *mmp_s;
+       if (smmp->func(smmp, argv[1], argv[2]) == 0) {
+               ext2fs_mmp_write(current_fs, current_fs->super->s_mmp_block,
+                                &set_mmp);
+               *mmp_s = set_mmp;
+       }
+}
+#else
+void do_set_mmp_value(int argc EXT2FS_ATTR((unused)),
+                     char *argv[] EXT2FS_ATTR((unused)))
+{
+       fprintf(stdout, "MMP is unsupported, please recompile with "
+                       "--enable-mmp\n");
+}
+#endif
+