From: Daniel Rosenberg Date: Thu, 11 Jun 2020 04:21:42 +0000 (-0700) Subject: AOSP: ANDROID: tune2fs: Support encrypt+casefold X-Git-Tag: v1.45.7~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23fc0e6e46f061175ef2af03538e137a490d17fb;p=thirdparty%2Fe2fsprogs.git AOSP: ANDROID: tune2fs: Support encrypt+casefold In preparation for upcoming kernel changes that will make the kernel support both encryption and casefolding at the same time, allow tune2fs to enable both features at the same time. Signed-off-by: Daniel Rosenberg Google-Bug-Id: 138322712 Test: Create fs with casefold and encryption enabled via tune2fs Change-Id: I36537a8b6dc5e2997b7016212f9b574c76673067 From AOSP commit: 44ac9dccd9853cc9807f0d6ce952bdcdeb93954a --- diff --git a/misc/tune2fs.c b/misc/tune2fs.c index 15fa36f28..cdf343c86 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -1419,12 +1419,6 @@ 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] = @@ -1432,12 +1426,6 @@ mmp_error: } if (FEATURE_ON(E2P_FEATURE_INCOMPAT, EXT4_FEATURE_INCOMPAT_CASEFOLD)) { - if (ext2fs_has_feature_encrypt(sb)) { - fputs(_("Cannot enable casefold feature on filesystems " - "with the encrypt feature enabled.\n"), - stderr); - return 1; - } if (mount_flags & EXT2_MF_MOUNTED) { fputs(_("The casefold feature may only be enabled when " "the filesystem is unmounted.\n"), stderr); @@ -2190,11 +2178,6 @@ static int parse_extended_opts(ext2_filsys fs, const char *opts) r_usage++; continue; } - if (ext2fs_has_feature_encrypt(sb)) { - fprintf(stderr, _("error: Cannot enable casefolding if encryption is set\n")); - r_usage++; - continue; - } if (mount_flags & EXT2_MF_MOUNTED) { fputs(_("The casefold feature may only be enabled when " "the filesystem is unmounted.\n"), stderr);