From: Theodore Tso <tytso@mit.edu>
To: Andreas Dilger <adilger@sun.com>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH 2/2] ext4: Automatically enable journal_async_commit on ext4 file systems
Date: Sat, 5 Sep 2009 21:32:45 -0400 [thread overview]
Message-ID: <20090906013245.GD2287@mit.edu> (raw)
In-Reply-To: <20090905225747.GP4197@webber.adilger.int>
On Sun, Sep 06, 2009 at 12:57:47AM +0200, Andreas Dilger wrote:
> On Sep 05, 2009 18:32 -0400, Theodore Ts'o wrote:
> > Now that we have cleaned up journal_async_commit, it's safe to enable
> > it all the time. But we only want to do so if ext4-specific INCOMPAT
> > features are enabled, since otherwise we will prevent the filesystem
> > from being mounted using ext3.
>
> So, the big question is what to do if not-the-last transaction in the
> journal has a bad block in it? This is fairly unlikely, and IMHO the
> harm of aborting journal replay too early is likely far outweighed by
> the benefit of not "recovering" garbage directly over the filesystem
> metadata.
>
> I had thought that you had rejected the e2fsck side of this patch for
> that reason, but maybe my memory is faulty... We still have some
> test images for bad journal checksums that you can have if you want.
No, it's in e2fsck. Right now, if we have a checksum failure, we
abort the journal replay dead in its tracks. Whether or not that's
the right thing is actually highly questionable. Yes, there's the
chance that we can recover garbage directly over the file system
metadata. But the flip side is that if we abort the journal replay
too early, we can end up leaving the filesystem horribly corrupted.
In addition, if the it's a block which has been journalled multiple
time (which will is highly likely for block allocation blocks or inode
allocation blocks), an error in the middle of the journal is not a
disaster.
The one thing I have to check is to make sure that e2fsck forces a
filesystem check if it aborts a journal replay due to a checksum
error. I'm pretty sure I did add that, but I need to make sure it's
there.
The other thing we might want to do is to add some code in ext4 is to
call jbd2_cleanup_journal_tail() a bit more aggressively. If all of
the blocks in the transaction has been pushed out, then updating the
journal superblock frequently will reduce the number of transactions
that need to be replayed. Right now, we often replay more transaction
that we strictly need to, out of a desire to reduce the need to update
the journal superblock. But we are replaying transactions 23..30, but
we really only need to replay transactions 28 29 and 30 in order to
bring the filesystem into consistency, and we have a checksum failure
while reading some of the data blocks found in transaction 25, we'll
end up never replaying transactions 28--30, and we may end up losing
data, especially if we already started writing some (but not all) of
the blocks involved with transactions 28 and 29 to their final
location on disk.
- Ted
next prev parent reply other threads:[~2009-09-06 1:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-05 22:32 [PATCH 1/2] ext4: Remove journal_checksum mount option and enable it by default Theodore Ts'o
2009-09-05 22:32 ` [PATCH 2/2] ext4: Automatically enable journal_async_commit on ext4 file systems Theodore Ts'o
2009-09-05 22:57 ` Andreas Dilger
2009-09-06 1:32 ` Theodore Tso [this message]
2009-09-06 2:57 ` Eric Sandeen
2009-09-07 23:48 ` Ric Wheeler
2009-09-07 23:42 ` Ric Wheeler
2009-09-08 4:45 ` Theodore Tso
2009-09-08 11:50 ` Ric Wheeler
2009-09-11 2:45 ` Theodore Tso
2009-09-11 11:07 ` Ric Wheeler
2009-09-11 13:13 ` Theodore Tso
2009-09-11 14:39 ` Ric Wheeler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090906013245.GD2287@mit.edu \
--to=tytso@mit.edu \
--cc=adilger@sun.com \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).