}
for (i=1; i < EXT2_NDIR_BLOCKS; i++) {
- if ((lpf_size += fs->blocksize) >= 16*1024)
+ /* Ensure that lost+found is at least 2 blocks, so we always
+ * test large empty blocks for big-block filesystems. */
+ if ((lpf_size += fs->blocksize) >= 16*1024 &&
+ lpf_size >= 2 * fs->blocksize)
break;
retval = ext2fs_expand_dir(fs, ino);
if (retval) {
if (s->s_reserved_gdt_blocks)
printf(_("Maximum filesystem blocks=%lu\n"),
(s->s_reserved_gdt_blocks + fs->desc_blocks) *
- (fs->blocksize / sizeof(struct ext2_group_desc)) *
- s->s_blocks_per_group);
+ EXT2_DESC_PER_BLOCK(s) * s->s_blocks_per_group);
if (fs->group_desc_count > 1)
printf(_("%u block groups\n"), fs->group_desc_count);
else
sb->s_creator_os = EXT2_OS_LINUX;
else if (strcasecmp(os, "GNU") == 0 || strcasecmp(os, "hurd") == 0)
sb->s_creator_os = EXT2_OS_HURD;
- else if (strcasecmp(os, "masix") == 0)
- sb->s_creator_os = EXT2_OS_MASIX;
else if (strcasecmp(os, "freebsd") == 0)
sb->s_creator_os = EXT2_OS_FREEBSD;
else if (strcasecmp(os, "lites") == 0)
bpg = param->s_blocks_per_group;
if (!bpg)
bpg = blocksize * 8;
- gdpb = blocksize / sizeof(struct ext2_group_desc);
+ gdpb = EXT2_DESC_PER_BLOCK(param);
group_desc_count =
ext2fs_div_ceil(param->s_blocks_count, bpg);
desc_blocks = (group_desc_count +
EXT2_FEATURE_COMPAT_EXT_ATTR,
/* Incompat */
EXT2_FEATURE_INCOMPAT_FILETYPE|
+ EXT3_FEATURE_INCOMPAT_EXTENTS|
EXT3_FEATURE_INCOMPAT_JOURNAL_DEV|
- EXT2_FEATURE_INCOMPAT_META_BG,
+ EXT2_FEATURE_INCOMPAT_META_BG|
+ EXT4_FEATURE_INCOMPAT_FLEX_BG,
/* R/O compat */
EXT2_FEATURE_RO_COMPAT_LARGE_FILE|
EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER
}
}
- if (!force && fs_param.s_blocks_count >= ((unsigned) 1 << 31)) {
- com_err(program_name, 0,
- _("Filesystem too large. No more than 2**31-1 blocks\n"
- "\t (8TB using a blocksize of 4k) are currently supported."));
- exit(1);
- }
-
- if ((blocksize > 4096) &&
- (fs_param.s_feature_compat & EXT3_FEATURE_COMPAT_HAS_JOURNAL))
- fprintf(stderr, _("\nWarning: some 2.4 kernels do not support "
- "blocksizes greater than 4096\n\tusing ext3. "
- "Use -b 4096 if this is an issue for you.\n\n"));
-
if (inode_size == 0) {
profile_get_integer(profile, "defaults", "inode_size", NULL,
0, &inode_size);
blocksize);
exit(1);
}
- if (inode_size != EXT2_GOOD_OLD_INODE_SIZE)
- fprintf(stderr, _("Warning: %d-byte inodes not usable "
- "on older systems\n"),
- inode_size);
fs_param.s_inode_size = inode_size;
}
errcode_t retval = 0;
ext2_filsys fs;
badblocks_list bb_list = 0;
- int journal_blocks;
+ unsigned int journal_blocks;
unsigned int i;
int val;
io_manager io_ptr;
goto no_journal;
}
if (!quiet) {
- printf(_("Creating journal (%d blocks): "),
+ printf(_("Creating journal (%u blocks): "),
journal_blocks);
fflush(stdout);
}