Whamcloud - gitweb
libcom_err: deal with the fact that the Hurd error messages are not zero-based
[tools/e2fsprogs.git] / misc / tune2fs.c
index cd4057c..301cf38 100644 (file)
@@ -1308,6 +1308,12 @@ mmp_error:
 
        if (FEATURE_ON(E2P_FEATURE_RO_INCOMPAT,
                       EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) {
+               if (mount_flags & EXT2_MF_MOUNTED) {
+                       fputs(_("Cannot enable uninit_bg on a mounted "
+                               "filesystem!\n"), stderr);
+                       exit(1);
+               }
+
                /* Do not enable uninit_bg when metadata_csum enabled */
                if (ext2fs_has_feature_metadata_csum(fs->super))
                        ext2fs_clear_feature_gdt_csum(fs->super);
@@ -1317,6 +1323,12 @@ mmp_error:
 
        if (FEATURE_OFF(E2P_FEATURE_RO_INCOMPAT,
                        EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) {
+               if (mount_flags & EXT2_MF_MOUNTED) {
+                       fputs(_("Cannot disable uninit_bg on a mounted "
+                               "filesystem!\n"), stderr);
+                       exit(1);
+               }
+
                err = disable_uninit_bg(fs,
                                EXT4_FEATURE_RO_COMPAT_GDT_CSUM);
                if (err)
@@ -1401,6 +1413,12 @@ mmp_error:
        }
 
        if (FEATURE_ON(E2P_FEATURE_INCOMPAT, EXT4_FEATURE_INCOMPAT_ENCRYPT)) {
+               if (ext2fs_has_feature_casefold(sb)) {
+                       fputs(_("Cannot enable encrypt feature on filesystems "
+                               "with the encoding feature enabled.\n"),
+                             stderr);
+                       return 1;
+               }
                fs->super->s_encrypt_algos[0] =
                        EXT4_ENCRYPTION_MODE_AES_256_XTS;
                fs->super->s_encrypt_algos[1] =