[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20201012152913.GI23665@quack2.suse.cz>
Date: Mon, 12 Oct 2020 17:29:13 +0200
From: Jan Kara <jack@...e.cz>
To: 常凤楠 <fengnanchang@...mail.com>
Cc: "Theodore Y. Ts'o" <tytso@....edu>,
Andreas Dilger <adilger@...ger.ca>, Jan Kara <jack@...e.cz>,
linux-ext4 <linux-ext4@...r.kernel.org>,
Fengnan Chang <changfengnan@...vision.com>
Subject: Re: [PATCH v4] jbd2: avoid transaction reuse after reformatting
On Fri 09-10-20 19:06:41, 常凤楠 wrote:
> Hi Jan:
> Thank you for your suggestions,I tested the new version of
> the patch,I think there still have some prblems. 1. Looks
> like you think jbd2_has_feature_checksum can determine that CRC is
> enabled,but this is different from jbd2_journal_has_csum_v2or3. so when
> csum is v2 or v3, this is still have problem. 2. This patch
> looks fixed the situations of descriptor and revoke block, commit block
> is not considered. Maybe it’s because my previous modification was
> problematic,I have a new idea, how about check crc first and compare
> timestap,if check crc is failed, then compare timestap, this way the risk
> will be much smaller. What do you think?
Hum, you're right that commit block checking will not work with v2/v3
checksums. Thanks for catching that! I like the order of checks you propose
to fix the problem, I'll update the patch. Thanks!
Honza
> ------------------ Original ------------------
> From: "Theodore Y. Ts'o" <tytso@....edu>;
> Date: Fri, Oct 9, 2020 10:16 AM
> To: "Andreas Dilger"<adilger@...ger.ca>;
> Cc: "Jan Kara"<jack@...e.cz>;"linux-ext4"<linux-ext4@...r.kernel.org>;"Fengnan Chang"<changfengnan@...vision.com>;"常凤楠"<fengnanchang@...mail.com>;
> Subject: Re: [PATCH v4] jbd2: avoid transaction reuse after reformatting
>
>
>
> On Thu, Oct 08, 2020 at 02:13:02PM -0600, Andreas Dilger wrote:
> > On Oct 7, 2020, at 2:13 AM, Jan Kara <jack@...e.cz> wrote:
> > >
> > > From: changfengnan <fengnanchang@...mail.com>
> > >
> > > When ext4 is formatted with lazy_journal_init=1 and transactions from
> > > the previous filesystem are still on disk, it is possible that they are
> > > considered during a recovery after a crash. Because the checksum seed
> > > has changed, the CRC check will fail, and the journal recovery fails
> > > with checksum error although the journal is otherwise perfectly valid.
> > > Fix the problem by checking commit block time stamps to determine
> > > whether the data in the journal block is just stale or whether it is
> > > indeed corrupt.
> > >
> > > Reported-by: kernel test robot <lkp@...el.com>
> > > Signed-off-by: Fengnan Chang <changfengnan@...vision.com>
> > > Signed-off-by: Jan Kara <jack@...e.cz>
> >
> > Reviewed-by: Andreas Dilger <adilger@...ger.ca>
> >
> > NB: one trivial formatting cleanup if patch is refreshed
> >
>
> Applied, thanks. I fixed the trivial format cleanup you pointed out,
> plus a whitespace fix pointed out by checkpatch.
>
> - Ted
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists