#include "../version.h"
#include "nls-enable.h"
-/*
- * Tune2fs supports these features in addition to the standard features.
- */
-#define EXT2_TUNE2FS_INCOMPAT (EXT3_FEATURE_INCOMPAT_EXTENTS)
-#define EXT2_TUNE2FS_RO_COMPAT (EXT4_FEATURE_RO_COMPAT_HUGE_FILE|\
- EXT4_FEATURE_RO_COMPAT_GDT_CSUM| \
- EXT4_FEATURE_RO_COMPAT_DIR_NLINK| \
- EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE)
-
-
const char * program_name = "tune2fs";
char * device_name;
char * new_label, *new_last_mounted, *new_UUID;
EXT4_FEATURE_INCOMPAT_FLEX_BG,
/* R/O compat */
EXT2_FEATURE_RO_COMPAT_LARGE_FILE |
+ EXT4_FEATURE_RO_COMPAT_HUGE_FILE|
+ EXT4_FEATURE_RO_COMPAT_DIR_NLINK|
+ EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE|
EXT4_FEATURE_RO_COMPAT_GDT_CSUM |
EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER
};
EXT4_FEATURE_INCOMPAT_FLEX_BG,
/* R/O compat */
EXT2_FEATURE_RO_COMPAT_LARGE_FILE |
+ EXT4_FEATURE_RO_COMPAT_HUGE_FILE|
+ EXT4_FEATURE_RO_COMPAT_DIR_NLINK|
+ EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE|
EXT4_FEATURE_RO_COMPAT_GDT_CSUM
};
if (FEATURE_OFF(E2P_FEATURE_COMPAT, EXT3_FEATURE_COMPAT_HAS_JOURNAL)) {
if ((mount_flags & EXT2_MF_MOUNTED) &&
!(mount_flags & EXT2_MF_READONLY)) {
- fputs(_("The has_journal flag may only be "
+ fputs(_("The has_journal feature may only be "
"cleared when the filesystem is\n"
"unmounted or mounted "
"read-only.\n"), stderr);
}
}
+ if (FEATURE_OFF(E2P_FEATURE_RO_INCOMPAT,
+ EXT4_FEATURE_RO_COMPAT_HUGE_FILE)) {
+ if ((mount_flags & EXT2_MF_MOUNTED) &&
+ !(mount_flags & EXT2_MF_READONLY)) {
+ fputs(_("The huge_file feature may only be "
+ "cleared when the filesystem is\n"
+ "unmounted or mounted "
+ "read-only.\n"), stderr);
+ exit(1);
+ }
+ }
+
if (sb->s_rev_level == EXT2_GOOD_OLD_REV &&
(sb->s_feature_compat || sb->s_feature_ro_compat ||
sb->s_feature_incompat))
EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER) ||
FEATURE_CHANGED(E2P_FEATURE_RO_INCOMPAT,
EXT4_FEATURE_RO_COMPAT_GDT_CSUM) ||
+ FEATURE_OFF(E2P_FEATURE_RO_INCOMPAT,
+ EXT4_FEATURE_RO_COMPAT_HUGE_FILE) ||
FEATURE_CHANGED(E2P_FEATURE_INCOMPAT,
EXT2_FEATURE_INCOMPAT_FILETYPE) ||
FEATURE_CHANGED(E2P_FEATURE_COMPAT,
EXT2_FEATURE_RO_COMPAT_LARGE_FILE)) {
sb->s_state &= ~EXT2_VALID_FS;
printf("\n%s\n", _(please_fsck));
+ if (mount_flags & EXT2_MF_READONLY)
+ printf(_("(and reboot afterwards!)\n"));
}
if ((old_features[E2P_FEATURE_COMPAT] != sb->s_feature_compat) ||
argv[1]);
exit(1);
}
- open_flag = EXT2_FLAG_SOFTSUPP_FEATURES | EXT2_FLAG_JOURNAL_DEV_OK;
+ open_flag = EXT2_FLAG_JOURNAL_DEV_OK;
if (argc == 3) {
open_flag |= EXT2_FLAG_RW;
L_flag = 1;
struct group * gr;
struct passwd * pw;
- open_flag = EXT2_FLAG_SOFTSUPP_FEATURES;
+ open_flag = 0;
printf("tune2fs %s (%s)\n", E2FSPROGS_VERSION, E2FSPROGS_DATE);
while ((c = getopt(argc, argv, "c:e:fg:i:jlm:o:r:s:u:C:E:I:J:L:M:O:T:U:")) != EOF)
exit(0);
}
-/*
- * Note! If any extended options are incompatible with the
- * intersection of the SOFTSUPP features and those features explicitly
- * enabled for tune2fs, there needs to be an explicit test for them
- * here.
- */
static void parse_extended_opts(ext2_filsys fs, const char *opts)
{
char *buf, *token, *next, *p, *arg;
}
sb = fs->super;
fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY;
- if ((sb->s_feature_incompat & !EXT2_TUNE2FS_INCOMPAT) ||
- (sb->s_feature_ro_compat & !EXT2_TUNE2FS_RO_COMPAT)) {
- fprintf(stderr,
- _("Filesystem %s has unsupported features enabled.\n"),
- device_name);
- exit(1);
- }
+
if (print_label) {
/* For e2label emulation */
printf("%.*s\n", (int) sizeof(sb->s_volume_name),
remove_error_table(&et_ext2_error_table);
exit(0);
}
+
retval = ext2fs_check_if_mounted(device_name, &mount_flags);
if (retval) {
com_err("ext2fs_check_if_mount", retval,