From: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
To: tytso@mit.edu, adilger@sun.com
Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org, jack@suse.cz
Subject: [PATCH 1/4] jbd2: abort when failed to log metadata buffers
Date: Fri, 10 Oct 2008 17:57:38 +0900 [thread overview]
Message-ID: <48EF1902.5050905@hitachi.com> (raw)
In-Reply-To: <48EF168A.4000705@hitachi.com>
If we failed to write metadata buffers to the journal space and
succeeded to write the commit record, stale data can be written
back to the filesystem as metadata in the recovery phase.
To avoid this, when we failed to write out metadata buffers,
abort the journal before writing the commit record.
We can also avoid this kind of corruption by using check-summing
feature because it can detect invalid metadata blocks in the
journal and avoid them from being replayed. So we don't need to
care about asynchronous commit record writeout with a check sum.
Signed-off-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
---
fs/jbd2/commit.c | 3 +++
1 file changed, 3 insertions(+)
Index: linux-2.6.27-rc9-ex4-1/fs/jbd2/commit.c
===================================================================
--- linux-2.6.27-rc9-ex4-1.orig/fs/jbd2/commit.c
+++ linux-2.6.27-rc9-ex4-1/fs/jbd2/commit.c
@@ -783,6 +783,9 @@ wait_for_iobuf:
/* AKPM: bforget here */
}
+ if (err)
+ jbd2_journal_abort(journal, err);
+
jbd_debug(3, "JBD: commit phase 5\n");
if (!JBD2_HAS_INCOMPAT_FEATURE(journal,
next prev parent reply other threads:[~2008-10-10 8:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-10 8:47 [PATCH 0/4] ext4/jbd2: possible filesystem corruption fixes Hidehiro Kawai
2008-10-10 8:57 ` Hidehiro Kawai [this message]
2008-10-10 8:58 ` [PATCH 2/4] jbd2: fix error handling for checkpoint io Hidehiro Kawai
2008-10-10 9:00 ` [PATCH 3/4] ext4: add checks for errors from jbd2 Hidehiro Kawai
2008-10-10 9:02 ` [PATCH 4/4] jbd2: don't dirty original metadata buffer on abort Hidehiro Kawai
2008-10-13 20:36 ` Joel Becker
2008-10-14 2:58 ` Theodore Tso
2008-10-11 4:25 ` [PATCH 0/4] ext4/jbd2: possible filesystem corruption fixes Theodore Tso
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=48EF1902.5050905@hitachi.com \
--to=hidehiro.kawai.ez@hitachi.com \
--cc=adilger@sun.com \
--cc=akpm@linux-foundation.org \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/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