Whamcloud - gitweb
tune2fs: Don't allow the -I option if the flex_bg feature is enabled
authorTheodore Ts'o <tytso@mit.edu>
Tue, 20 Jan 2009 06:50:07 +0000 (01:50 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 20 Jan 2009 06:50:07 +0000 (01:50 -0500)
With flex_bg usually the inode table for most block groups are packed
right against each other, so expanding the inode table size needs
special handling that's not currently in tune2fs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
misc/tune2fs.c

index e72518a..14529e3 100644 (file)
@@ -1409,7 +1409,7 @@ static int tune2fs_setup_tdb(const char *name, io_manager *io_ptr)
        set_undo_io_backing_manager(*io_ptr);
        *io_ptr = undo_io_manager;
        set_undo_io_backup_file(tdb_file);
-       printf(_("To undo the tune2fs operations please run "
+       printf(_("To undo the tune2fs operation please run "
                 "the command\n    e2undo %s %s\n\n"),
                 tdb_file, name);
        free(tmp_name);
@@ -1652,6 +1652,13 @@ retry_open:
                                "unmounted.\n"), stderr);
                        exit(1);
                }
+               if (fs->super->s_feature_incompat &
+                   EXT4_FEATURE_INCOMPAT_FLEX_BG) {
+                       fputs(_("Changing the inode size not supported for filesystems "
+                               "with the flex_bg\nfeature enabled.\n"),
+                             stderr);
+                       exit(1);
+               }
                /*
                 * We want to update group descriptor also
                 * with the new free inode count