#define E2F_OPT_ICOUNT_FULLMAP 0x20000 /* use an array for inode counts */
#define E2F_OPT_UNSHARE_BLOCKS 0x40000
#define E2F_OPT_CLEAR_UNINIT 0x80000 /* Hack to clear the uninit bit */
+#define E2F_OPT_CHECK_ENCODING 0x100000 /* Force verification of encoded filenames */
/*
* E2fsck flags
ctx = cd->ctx;
/* We only want filename encoding verification on strict
- * mode. */
+ * mode or if explicitly requested by user. */
if (ext2fs_test_inode_bitmap2(ctx->inode_casefold_map, ino) &&
- (ctx->fs->super->s_encoding_flags & EXT4_ENC_STRICT_MODE_FL))
+ ((ctx->fs->super->s_encoding_flags & EXT4_ENC_STRICT_MODE_FL) ||
+ (ctx->options & E2F_OPT_CHECK_ENCODING)))
cf_dir = 1;
if (ctx->flags & E2F_FLAG_RUN_RETURN)
ctx->options |= E2F_OPT_UNSHARE_BLOCKS;
ctx->options |= E2F_OPT_FORCE;
continue;
+ } else if (strcmp(token, "check_encoding") == 0) {
+ ctx->options |= E2F_OPT_CHECK_ENCODING;
+ continue;
#ifdef CONFIG_DEVELOPER_FEATURES
} else if (strcmp(token, "clear_all_uninit_bits") == 0) {
ctx->options |= E2F_OPT_CLEAR_UNINIT;
fputs("\tbmap2extent\n", stderr);
fputs("\tunshare_blocks\n", stderr);
fputs("\tfixes_only\n", stderr);
+ fputs("\tcheck_encoding\n", stderr);
fputc('\n', stderr);
exit(1);
}