[Ocfs2-tools-commits] zab commits r476 - trunk/fsck.ocfs2
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Fri Dec 10 14:01:52 CST 2004
Author: zab
Date: 2004-12-10 14:01:50 -0600 (Fri, 10 Dec 2004)
New Revision: 476
Modified:
trunk/fsck.ocfs2/fsck.c
trunk/fsck.ocfs2/journal.c
Log:
o minor cleanup of recent journal changes, mostly getting
the sense of JOURNAL_DIRTY_FL right when prepping
Modified: trunk/fsck.ocfs2/fsck.c
===================================================================
--- trunk/fsck.ocfs2/fsck.c 2004-12-10 19:34:54 UTC (rev 475)
+++ trunk/fsck.ocfs2/fsck.c 2004-12-10 20:01:50 UTC (rev 476)
@@ -373,7 +373,7 @@
}
printf("%s wasn't cleanly unmounted by all nodes. Attempting to "
- "replay the journals for nodes that didn't unmount cleanly",
+ "replay the journals for nodes that didn't unmount cleanly\n",
filename);
/* journal replay is careful not to use ost as we only really
Modified: trunk/fsck.ocfs2/journal.c
===================================================================
--- trunk/fsck.ocfs2/journal.c 2004-12-10 19:34:54 UTC (rev 475)
+++ trunk/fsck.ocfs2/journal.c 2004-12-10 20:01:50 UTC (rev 476)
@@ -454,8 +454,6 @@
{
errcode_t err;
- ji->ji_revoke = RB_ROOT;
- ji->ji_node = node;
err = ocfs2_malloc_blocks(fs->fs_io, 1, &ji->ji_jsb);
if (err)
@@ -477,10 +475,9 @@
goto out;
}
- if (ji->ji_cinode->ci_inode->id1.journal1.ij_flags & OCFS2_JOURNAL_DIRTY_FL) {
- ji->ji_replay = 0;
+ if (!(ji->ji_cinode->ci_inode->id1.journal1.ij_flags &
+ OCFS2_JOURNAL_DIRTY_FL))
goto out;
- }
err = ocfs2_extent_map_init(fs, ji->ji_cinode);
if (err) {
@@ -503,6 +500,8 @@
goto out;
}
+ ji->ji_replay = 1;
+
verbosef("node: %d jsb start %u maxlen %u\n", node,
ji->ji_jsb->s_start, ji->ji_jsb->s_maxlen);
out:
@@ -597,23 +596,26 @@
printf("Checking each node's journal.\n");
for (i = 0, ji = jis; i < max_nodes; i++, ji++) {
- ji->ji_replay = 1;
ji->ji_used_blocks = used_blocks;
+ ji->ji_revoke = RB_ROOT;
+ ji->ji_node = i;
+ /* sets ji->ji_replay */
err = prep_journal_info(fs, i, ji);
- if (err == 0) {
- /* Will only be modified in prep_journal_info()
- * if 0 is returned */
- if (!ji->ji_replay) {
- verbosef("node %d is clean\n", i);
- continue;
- }
+ if (err) {
+ printf("Node %d seems to have a corrupt journal.\n",
+ i);
+ journal_trouble = 1;
+ continue;
+ }
- err = walk_journal(fs, i, ji, buf, 0);
+ if (!ji->ji_replay) {
+ verbosef("node %d is clean\n", i);
+ continue;
}
+ err = walk_journal(fs, i, ji, buf, 0);
if (err) {
- ji->ji_replay = 0;
printf("Node %d's journal can not be replayed.\n", i);
journal_trouble = 1;
}
More information about the Ocfs2-tools-commits
mailing list