Whamcloud - gitweb
LU-9501 mke2fs: avoid inode number error with large FS
authorAlexey Lyashkov <alexey.lyashkov@seagate.com>
Mon, 15 May 2017 14:45:38 +0000 (17:45 +0300)
committerLi Dongyang <dongyangli@ddn.com>
Wed, 29 May 2019 04:47:27 +0000 (14:47 +1000)
Limit inodes count instead of error return, to use all inodes in
the filesystem.

Change-Id: I76ee0a6c11b099b8c17d90b0778e3c0f0cf1f60a
Signed-off-by: Alexey Lyashkov <alexey.lyashkov@seagate.com>
Reviewed-on: https://review.whamcloud.com/27111
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
misc/mke2fs.c

index acf153b..10da2f1 100644 (file)
@@ -2523,14 +2523,11 @@ profile_error:
                unsigned long long n;
                n = ext2fs_blocks_count(&fs_param) * blocksize / inode_ratio;
                if (n > MAX_32_NUM) {
-                       if (ext2fs_has_feature_64bit(&fs_param))
-                               num_inodes = MAX_32_NUM;
-                       else {
+                       num_inodes = MAX_32_NUM;
+                       if (!ext2fs_has_feature_64bit(&fs_param))
                                com_err(program_name, 0,
-                                       _("too many inodes (%llu), raise "
-                                         "inode ratio?"), n);
-                               exit(1);
-                       }
+                                       _("too many inodes (%llu), reduced to "
+                                         "%llu"), n, MAX_32_NUM);
                }
        } else if (num_inodes > MAX_32_NUM) {
                com_err(program_name, 0,