de_b = (const struct ext2_dir_entry *) b;
b_len = ext2fs_dirent_name_len(de_b);
- return ext2fs_casefold_cmp(tbl, de_a->name, a_len, de_b->name, b_len);
+ return ext2fs_casefold_cmp(tbl, (unsigned char *) de_a->name, a_len,
+ (unsigned char *) de_b->name, b_len);
}
/*
root = (struct ext2_dx_root_info *) (buf + 24);
dx_db->type = DX_DIRBLOCK_ROOT;
dx_db->flags |= DX_FLAG_FIRST | DX_FLAG_LAST;
+
+ /* large_dir was set in pass1 if large dirs were found,
+ * so ext2_dir_htree_level() should now be correct */
if ((root->reserved_zero ||
root->info_length < 8 ||
root->indirect_levels >=
if (inode.i_flags & EXT4_INLINE_DATA_FL)
goto clear_inode;
- if (LINUX_S_ISREG(inode.i_mode) &&
- ext2fs_needs_large_file_feature(EXT2_I_SIZE(&inode)))
- ctx->large_files--;
+ if (ext2fs_needs_large_file_feature(EXT2_I_SIZE(&inode))) {
+ if (LINUX_S_ISREG(inode.i_mode))
+ ctx->large_files--;
+ else if (LINUX_S_ISDIR(inode.i_mode))
+ ctx->large_dirs--;
+ }
del_block.ctx = ctx;
del_block.num = 0;
not_fixed++;
}
if (inode.i_size_high && !ext2fs_has_feature_largedir(fs->super) &&
+ inode.i_blocks < 1ULL << (29 - EXT2_BLOCK_SIZE_BITS(fs->super)) &&
LINUX_S_ISDIR(inode.i_mode)) {
if (fix_problem(ctx, PR_2_DIR_SIZE_HIGH_ZERO, &pctx)) {
inode.i_size_high = 0;