diff options
author | Theodore Ts'o <tytso@mit.edu> | 2011-10-03 23:47:19 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-10-03 23:47:19 -0400 |
commit | 00ea586fb23f88da616c27d66faf210532c12b5a (patch) | |
tree | 434a3bd10b461169d5d9c6f42df4f512fd8e7467 /lib | |
parent | 466137fb7eaf6d54aa8d174054ed17eaed52eac8 (diff) | |
download | e2fsprogs-00ea586fb23f88da616c27d66faf210532c12b5a.tar.gz |
libext2fs: fix bad cast which causes problems for file systems > 512EB
If the number of block groups exceeds 2**32, a bad cast would lead to
a bogus "Not enough space to build proposed filesystem while setting
up superblock" failure.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ext2fs/initialize.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ext2fs/initialize.c b/lib/ext2fs/initialize.c index 2875f97e..b050a0a9 100644 --- a/lib/ext2fs/initialize.c +++ b/lib/ext2fs/initialize.c @@ -248,7 +248,7 @@ errcode_t ext2fs_initialize(const char *name, int flags, } retry: - fs->group_desc_count = (blk_t) ext2fs_div64_ceil( + fs->group_desc_count = (dgrp_t) ext2fs_div64_ceil( ext2fs_blocks_count(super) - super->s_first_data_block, EXT2_BLOCKS_PER_GROUP(super)); if (fs->group_desc_count == 0) { |