Whamcloud - gitweb
Merge branch 'maint'
[tools/e2fsprogs.git] / misc / mke2fs.c
index fc086a4..072a3a8 100644 (file)
@@ -535,7 +535,10 @@ static void create_lost_and_found(ext2_filsys fs)
        }
        
        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) {
@@ -694,8 +697,7 @@ static void show_stats(ext2_filsys fs)
        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
@@ -741,8 +743,6 @@ static int set_os(struct ext2_super_block *sb, char *os)
                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)
@@ -844,7 +844,7 @@ static void parse_extended_opts(struct ext2_super_block *param,
                        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 +
@@ -906,8 +906,10 @@ static __u32 ok_features[3] = {
                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
@@ -1475,19 +1477,6 @@ static void PRS(int argc, char *argv[])
                }
        }
 
-       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);
@@ -1506,10 +1495,6 @@ static void PRS(int argc, char *argv[])
                                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;
        }
 
@@ -1562,7 +1547,7 @@ int main (int argc, char *argv[])
        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;
@@ -1773,7 +1758,7 @@ int main (int argc, char *argv[])
                        goto no_journal;
                }
                if (!quiet) {
-                       printf(_("Creating journal (%d blocks): "),
+                       printf(_("Creating journal (%u blocks): "),
                               journal_blocks);
                        fflush(stdout);
                }