From: Darrick J. Wong Date: Fri, 19 Sep 2014 06:01:43 +0000 (-0400) Subject: debugfs: manage needs_recover feature when messing with the journal X-Git-Tag: v1.43-WIP-2015-05-18~171 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53c5d6062e2c13bf180605bf84147e06018794e2;p=thirdparty%2Fe2fsprogs.git debugfs: manage needs_recover feature when messing with the journal Set the needs_recover incompat feature when debugfs writes journal transactions so that we actually replay the journal contents at the next mount. Likewise, clear it if we successfully recover the journal. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o --- diff --git a/debugfs/do_journal.c b/debugfs/do_journal.c index 711ed277a..a17af6e5b 100644 --- a/debugfs/do_journal.c +++ b/debugfs/do_journal.c @@ -158,6 +158,8 @@ static errcode_t journal_commit_trans(journal_transaction_t *trans) trans->flags &= ~J_TRANS_OPEN; trans->block++; + trans->fs->super->s_feature_incompat |= EXT3_FEATURE_INCOMPAT_RECOVER; + ext2fs_mark_super_dirty(trans->fs); error: if (cbh) brelse(cbh); @@ -979,4 +981,9 @@ void do_journal_run(int argc, char *argv[]) err = ext2fs_run_ext3_journal(¤t_fs); if (err) com_err("journal_run", err, "while recovering journal"); + else { + current_fs->super->s_feature_incompat &= + ~EXT3_FEATURE_INCOMPAT_RECOVER; + ext2fs_mark_super_dirty(current_fs); + } }