Whamcloud - gitweb
Write the updated journal inode if s_jnl_blocks was successfully used
authorKalpak Shah <kalpak@clusterfs.com>
Thu, 21 Jun 2007 15:59:06 +0000 (11:59 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 21 Jun 2007 15:59:06 +0000 (11:59 -0400)
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>
e2fsck/journal.c

index 1f10305..18dab0e 100644 (file)
@@ -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