[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180620075937.fppeiyar35fs6rmz@quack2.suse.cz>
Date: Wed, 20 Jun 2018 09:59:37 +0200
From: Jan Kara <jack@...e.cz>
To: "Theodore Y. Ts'o" <tytso@....edu>
Cc: Jan Kara <jack@...e.cz>, linux-ext4@...r.kernel.org
Subject: Re: [PATCH 06/10] e2fsck: Handle s_inodes_count corruption properly
On Tue 19-06-18 11:25:35, Theodore Y. Ts'o wrote:
> 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@...e.cz>
>
> Applied with the following fix-up patch. (The entries in the problem
> array must be in problem_code sort order.)
Thanks for fixing that up!
Honza
> 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 */
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists