diff options
author | Theodore Ts'o <tytso@mit.edu> | 2014-08-03 12:22:27 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2014-08-04 18:58:17 -0400 |
commit | 457e49981e7881d22f5621a37c7097535a863988 (patch) | |
tree | 9a59e19be9b4be687ebecbc174e1a52d0767712d | |
parent | bf140bf29866991a3711688a5182fc5b1ae7c7cd (diff) | |
download | e2fsprogs-457e49981e7881d22f5621a37c7097535a863988.tar.gz |
Revert "mke2fs: prevent creation of unmountable ext4 with large flex_bg count"
This reverts commit d988201ef9cb6f7b521e544061976ab4270a3f89.
The problem with this commit is that causes common small file system
configurations to fail. For example:
mke2fs -O flex_bg -b 4096 -I 1024 -F /tmp/tt 79106
mke2fs 1.42.11 (09-Jul-2014)
/tmp/tt: Invalid argument passed to ext2 library while setting
up superblock
This check in ext2fs_initialize() was added to prevent the metadata
from being allocated beyond the end of the filesystem, but it is
also causing a wide range of failures for small filesystems.
We'll address this in a different way, by using a smarter algorithm
for deciding the layout of metadata blocks for the last flex block
group.
Reported-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r-- | lib/ext2fs/initialize.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/lib/ext2fs/initialize.c b/lib/ext2fs/initialize.c index de358fd8..36c94a9a 100644 --- a/lib/ext2fs/initialize.c +++ b/lib/ext2fs/initialize.c @@ -91,10 +91,8 @@ errcode_t ext2fs_initialize(const char *name, int flags, unsigned int rem; unsigned int overhead = 0; unsigned int ipg; - unsigned int flexbg_size; dgrp_t i; blk64_t free_blocks; - blk64_t flexbg_overhead; blk_t numblocks; int rsv_gdt; int csum_flag; @@ -421,28 +419,6 @@ ipg_retry: } /* - * Calculate the flex_bg related metadata blocks count. - * It includes the boot block, the super block, - * the block group descriptors, the reserved gdt blocks, - * the block bitmaps, the inode bitmaps and the inode tables. - * This is a simple check, so that the backup superblock and - * other feature related blocks are not considered. - */ - flexbg_size = 1 << fs->super->s_log_groups_per_flex; - flexbg_overhead = super->s_first_data_block + 1 + - fs->desc_blocks + super->s_reserved_gdt_blocks + - (__u64)flexbg_size * (2 + fs->inode_blocks_per_group); - - /* - * Disallow creating ext4 which breaks flex_bg metadata layout - * obviously. - */ - if (flexbg_overhead > ext2fs_blocks_count(fs->super)) { - retval = EXT2_ET_INVALID_ARGUMENT; - goto cleanup; - } - - /* * At this point we know how big the filesystem will be. So * we can do any and all allocations that depend on the block * count. |