On Tue, Jun 12, 2018 at 11:53:24AM +0200, Jan Kara wrote: > When s_inodes_count would overflow given number of groups and inodes per > group, we cannot currently fix the breakage in e2fsck as that requires > trimming number of groups or inodes per group which both means data & > inode migration etc. Just trimming sb->s_inodes_count is not enough as > kernel's inode allocation code is not able to handle filesystems where > not all inodes in the last group are usable. So don't pretend we can fix > s_inodes_count overflow by just trimming the s_inodes_count value. > > When s_inodes_count is just wrong but will not overflow, let's fix it. > Also move this check before we use s_inodes_count for checking > s_first_ino. > > Signed-off-by: Jan Kara <jack@xxxxxxx> Applied with the following fix-up patch. (The entries in the problem array must be in problem_code sort order.) - Ted diff --git a/e2fsck/problem.c b/e2fsck/problem.c index 8de558edc..efe98c920 100644 --- a/e2fsck/problem.c +++ b/e2fsck/problem.c @@ -184,11 +184,6 @@ static struct e2fsck_problem problem_table[] = { N_("@i count in @S is %i, @s %j.\n"), PROMPT_FIX, 0 }, - /* Too many inodes in the filesystem */ - { PR_0_INODE_COUNT_BIG, - N_("@S would have too many inodes (%N).\n"), - PROMPT_NONE, PR_AFTER_CODE, PR_0_SB_CORRUPT }, - { PR_0_HURD_CLEAR_FILETYPE, N_("The Hurd does not support the filetype feature.\n"), PROMPT_CLEAR, 0 }, @@ -498,6 +493,11 @@ static struct e2fsck_problem problem_table[] = { N_("Invalid %U @q @i %i. "), PROMPT_FIX, 0 }, + /* Too many inodes in the filesystem */ + { PR_0_INODE_COUNT_BIG, + N_("@S would have too many inodes (%N).\n"), + PROMPT_NONE, PR_AFTER_CODE, PR_0_SB_CORRUPT }, + /* Pass 1 errors */ /* Pass 1: Checking inodes, blocks, and sizes */