summaryrefslogtreecommitdiff
path: root/e2fsck
diff options
context:
space:
mode:
authorKalpak Shah <kalpak@clusterfs.com>2007-06-21 11:59:06 -0400
committerTheodore Ts'o <tytso@mit.edu>2007-06-21 11:59:06 -0400
commitded28ac2ab67300f39783184a8f8930b548fc5f0 (patch)
tree30093e3d61c6ff5cb9976732e8f7a8a33d86a0c0 /e2fsck
parent5107d0d196b9c51cf18380b6996b1074afe51df2 (diff)
downloade2fsprogs-ded28ac2ab67300f39783184a8f8930b548fc5f0.tar.gz
Write the updated journal inode if s_jnl_blocks was successfully used
If the journal inode was corrected from s_jnl_blocks, write the fixed journal inode back to disk. Signed-off-by: Kalpak Shah <kalpak@clusterfs.com> Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Diffstat (limited to 'e2fsck')
-rw-r--r--e2fsck/journal.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/e2fsck/journal.c b/e2fsck/journal.c
index 1f10305d..18dab0e9 100644
--- a/e2fsck/journal.c
+++ b/e2fsck/journal.c
@@ -285,6 +285,13 @@ static errcode_t e2fsck_get_journal(e2fsck_t ctx, journal_t **ret_journal)
goto try_backup_journal;
}
}
+ if (tried_backup_jnl && !(ctx->options & E2F_OPT_READONLY)) {
+ retval = ext2fs_write_inode(ctx->fs, sb->s_journal_inum,
+ &j_inode->i_ext2);
+ if (retval)
+ goto errout;
+ }
+
journal->j_maxlen = j_inode->i_ext2.i_size / journal->j_blocksize;
#ifdef USE_INODE_IO