fs_journal.sg — write-ahead journal for crash-safe VFS operations. STABLE pillar: protects ext2 metadata mutations against crash corruption. Append-only WAL at /<pfx>/journal/wal. ABCDEFG pass, 27/27 suite green.
Journal operations
create / mkdir
Log file creation and directory creation to WAL before mutating ext2 metadata.
unlink / append
Log deletion and data append operations — recoverable on crash.
commit
Commit marker seals a transaction — all ops before the marker are atomic.
recovery replay
On mount, replays uncommitted entries from the WAL to restore consistency.
Entry format
seq(4) + op(1) + pathlen(2) + datalen(4) + path + data — compact binary, no parsing ambiguity.