Hello,

ext2fs does not replay its journal, e2fsck does.  This series makes
the journal's state on disk tell e2fsck the truth, and makes ext2fs
pick up after e2fsck instead of writing over what it did.
It finishes what was started with commit d4bf2ca97.

The first patch keeps the needs_recovery flag set on disk whenever the
log may hold transactions.  Before, it was set lazily through the
journal and cleared before the log was empty, so a crash could leave
"needs_recovery flag is clear, but journal has data", which stops a
boot-time "fsck -p".

The second runs the journal only while the filesystem is writable.
The root is mounted read-only, e2fsck replays the log, and the remount
read-write used to keep writing at the old log head.  The journal now
starts from the on-disk journal superblock when the filesystem becomes
writable, and stops cleanly when it becomes read-only.  A log that was
never replayed keeps the filesystem read-only until e2fsck has run.

The third frees the journal when it stops, which the second makes
happen on every read-only/writable cycle.  The fourth sets the revoke
feature that the journal relies on, and runs without a journal, with
a warning, when the journal has features ext2fs does not write
(64-bit tags, checksums).

Milos

Milos Nikic (4):
  ext2fs: Keep the needs_recovery flag on disk while the journal has
    data
  ext2fs: Run the journal only while the filesystem is writable
  ext2fs: Free the journal when it stops
  ext2fs: Check the journal's features, and declare revoke records

 ext2fs/ext2fs.c      | 106 +++++++++++++++++++++++++---
 ext2fs/ext2fs.h      |  14 ++++
 ext2fs/hyper.c       | 119 +++++++++++++++++++++++++++----
 ext2fs/jbd2_format.h |  15 ++++
 ext2fs/journal.c     | 163 ++++++++++++++++++++++++++++++++++++++++---
 ext2fs/journal.h     |  15 ++++
 6 files changed, 398 insertions(+), 34 deletions(-)

-- 
2.56.0


Reply via email to