Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 1099

kernel-2.6.18-238.el5.src.rpm

From: Hideo AOKI <haoki@redhat.com>
Date: Thu, 21 Aug 2008 12:55:33 -0400
Subject: [fs] jdb: abort when failed to log metadata buffers
Message-id: 48AD9E05.8000203@redhat.com
O-Subject: [RHEL 5.3 PATCH 3/6] bz#439581: jdb: abort when failed to log metadata buffers
Bugzilla: 439581
RH-Acked-by: Josef Bacik <jbacik@redhat.com>
RH-Acked-by: Eric Sandeen <sandeen@redhat.com>

BZ#:
------
https://bugzilla.redhat.com/show_bug.cgi?id=439581

Upstream Status:
----------------
This patch is currently in -mm tree snap shot.
http://marc.info/?l=linux-mm-commits&m=121731468014512&w=2

Description:
------------
From: Hidehiro Kawai <hidehiro.kawai.ez@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.

Signed-off-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
Acked-by: Jan Kara <jack@suse.cz>
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c
index f87c878..62cd9f2 100644
--- a/fs/jbd/commit.c
+++ b/fs/jbd/commit.c
@@ -737,6 +737,9 @@ wait_for_iobuf:
 		/* AKPM: bforget here */
 	}
 
+	if (err)
+		journal_abort(journal, err);
+
 	jbd_debug(3, "JBD: commit phase 6\n");
 
 	if (journal_write_commit_record(journal, commit_transaction))