[Ocfs2-tools-devel] [PATCH] ocfs2_journal_check_available_features(): Never allow FEATURE_COMPAT_CHECKSUM

Joel Becker Joel.Becker at oracle.com
Tue Nov 17 12:46:39 PST 2009


ocfs2 will never use jbd2 checksums.  If a jbd2 checksum fails, the
transaction is not replayed.  This means that some parts of the
transaction may have checkpointed while other parts have not.  This
inconsistent state requires fsck to repair.  ocfs2, being clustered,
can't tolerate that situation.  Instead, ocfs2 prefers to replay the
journal.  This allows the cluster to remain running.  Using the METAECC
feature allows ocfs2 to detect and isolate any corrupted blocks.

Signed-off-by: Joel Becker <joel.becker at oracle.com>
---
 libocfs2/mkjournal.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/libocfs2/mkjournal.c b/libocfs2/mkjournal.c
index 8575c40..cb0e2ee 100644
--- a/libocfs2/mkjournal.c
+++ b/libocfs2/mkjournal.c
@@ -62,6 +62,19 @@ static int ocfs2_journal_check_available_features(journal_superblock_t *jsb,
 	    features->opt_compat)
 		return 0;
 
+	/*
+	 * ocfs2 will never use jbd2 checksums.  If a jbd2 checksum fails,
+	 * the transaction is not replayed.  This means that some parts of
+	 * the transaction may have checkpointed while other parts have not.
+	 * This inconsistent state requires fsck to repair.  ocfs2, being
+	 * clustered, can't tolerate that situation.  Instead, ocfs2
+	 * prefers to replay the journal.  This allows the cluster to
+	 * remain running.  Using the METAECC feature allows ocfs2 to
+	 * detect and isolate any corrupted blocks.
+	 */
+	if (features->opt_compat & JBD2_FEATURE_COMPAT_CHECKSUM)
+		return 0;
+
 	if ((features->opt_ro_compat & JBD2_KNOWN_ROCOMPAT_FEATURES) !=
 	    features->opt_ro_compat)
 		return 0;
-- 
1.6.5.2


-- 

"Too much walking shoes worn thin.
 Too much trippin' and my soul's worn thin.
 Time to catch a ride it leaves today
 Her name is what it means.
 Too much walking shoes worn thin."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list