This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hurd".
The branch, master has been updated
via aacc4db31f99d0a5ac95261463a2ab9e577a4f8a (commit)
via bc8ac23d670ad3aeaddf693d30cdc2abbf9952af (commit)
from 2288b69cd8339c66709a4fb960eb37fb92bfdf3c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit aacc4db31f99d0a5ac95261463a2ab9e577a4f8a
Author: Samuel Thibault <[email protected]>
Date: Wed May 27 02:19:23 2026 +0200
ext2fs: make dino_ref use dino_block
commit bc8ac23d670ad3aeaddf693d30cdc2abbf9952af
Author: Milos Nikic <[email protected]>
Date: Thu Feb 5 16:41:37 2026 -0800
ext2fs: Add JBD2 journaling to ext2/libdiskfs
This patch introduces a JBD2-compliant journaling driver to ext2fs,
enabling crash consistency for metadata operations. The implementation
is binary-compatible with Linux's JBD2, allowing standard tools like
e2fsck/tune2fs to safely mount, replay, and recover the filesystem state.
It also introduces hooks across libdiskfs VFS RPC endpoints to safely
wrap logical operations in atomic transactions.
Key Features:
1. JBD2 Compatibility: Implements the JBD2 on-disk format (v2), including
descriptor blocks, commit records, and basic revocation tables.
The filesystem is now recognized and mountable as "ext3" by Linux.
2. Writeback Mode: Implements "Writeback" journaling semantics.
Metadata (inodes, bitmaps) is journaled and crash-consistent. File data
is flushed lazily by the VM pager. This provides the best performance
but allows for "stale data" in recently allocated blocks if a crash
occurs before the data flush (matching ext3/4 data=writeback behavior).
Synchronous mounts (-o sync) strictly force data flushes before commit.
3. Journal Thread (kjournald): A dedicated background thread manages the
commit lifecycle, waking up periodically (default 5s) to batch and write
transactions to the journal ring buffer. This decouples metadata updates
from physical disk I/O, preventing the "stop-the-world" latency of
synchronous metadata writes.
4. Progressive Checkpointing: As soon as the VM pager writes physical
filesystem blocks to disk, the journal is notified asynchronously.
This allows the journal tail to advance continuously, ensuring the
ring buffer remains mostly empty and preventing pipeline stalls.
5. Locking & Mach VM Strategy: Introduces `journal_t` with a strictly
encapsulated internal state lock. It safely integrates with the Mach VM
pager via a block-device filter layer (store_write/store_read
interceptors).
If the pager asynchronously attempts to flush ("rush") blocks that are
tied to an actively committing transaction, the journal redirects these
payloads into a temporary "Lifeboat" cache. This preserves strict
Write-Ahead Log (WAL) ordering and prevents VM deadlocks without
stalling the pager or emitting warnings on the happy path.
6. Declarative VFS API: libdiskfs operations are decoupled from journal
internals via a shared-transaction model. Nested RPCs safely share a
single transaction using a reference counter (t_updates). Top-level
operations requiring strict POSIX synchronous guarantees use a blocking
commit, while background and orphan tasks utilize a lock-free
auto-commit
safety net when their reference count drops to zero.
Fast-Path Optimizations:
The hottest path in the codebase is `journal_dirty_block()`, which is called
whenever a filesystem block is altered (thousands of times per second on
heavy
workloads). Care was taken to optimize this function to ensure near-zero
performance penalty for enabling journaling:
- Custom Robin Hood Hash Map: Provides O(1) transaction buffer lookups
with tight cache locality.
- Slab Allocator Pool: A pre-allocated pool (512 buffers) makes dirtying
a block a zero-allocation operation during normal workloads,
significantly
reducing CPU overhead during metadata storms (e.g., compile scripts).
- Deferred Memory Hydration: The 4KB Mach VM memory copy is deferred
entirely out of the VFS hot-path. Instead of eagerly copying memory
while holding node locks, the copy is safely deferred to the
transaction's
quiescent state (when t_updates == 0). This eliminates redundant memory
copies and completely removes lock contention from the VFS layer,
allowing
journaled throughput to match unjournaled speeds.
Tested on both 32 and 64 bit architectures.
-----------------------------------------------------------------------
Summary of changes:
ext2fs/Makefile | 2 +-
ext2fs/balloc.c | 2 +
ext2fs/ext2_fs.h | 3 +-
ext2fs/ext2fs.c | 24 +
ext2fs/ext2fs.h | 96 +-
ext2fs/getblk.c | 6 +-
ext2fs/hyper.c | 12 +-
ext2fs/inode.c | 33 +-
ext2fs/jbd2_format.h | 102 ++
ext2fs/journal.c | 2415 ++++++++++++++++++++++++++++++++++++++++++++
ext2fs/journal.h | 108 ++
ext2fs/pager.c | 60 +-
ext2fs/truncate.c | 2 +
libdiskfs/Makefile | 2 +-
libdiskfs/conch-fetch.c | 5 +-
libdiskfs/dir-init.c | 12 +
libdiskfs/dir-link.c | 26 +-
libdiskfs/dir-lookup.c | 7 +
libdiskfs/dir-mkdir.c | 17 +-
libdiskfs/dir-mkfile.c | 25 +-
libdiskfs/dir-rename.c | 100 +-
libdiskfs/dir-renamed.c | 44 +-
libdiskfs/dir-rmdir.c | 14 +-
libdiskfs/dir-unlink.c | 17 +-
libdiskfs/diskfs.h | 68 +-
libdiskfs/file-set-trans.c | 39 +-
libdiskfs/io-prenotify.c | 17 +-
libdiskfs/io-read.c | 4 +-
libdiskfs/io-sigio.c | 14 +-
libdiskfs/io-stat.c | 6 +-
libdiskfs/io-write.c | 21 +-
libdiskfs/journal.c | 68 ++
libdiskfs/node-create.c | 4 +-
libdiskfs/node-drop.c | 14 +-
libdiskfs/node-rdwr.c | 7 +-
libdiskfs/priv.h | 9 +-
36 files changed, 3221 insertions(+), 184 deletions(-)
create mode 100644 ext2fs/jbd2_format.h
create mode 100644 ext2fs/journal.c
create mode 100644 ext2fs/journal.h
create mode 100644 libdiskfs/journal.c
hooks/post-receive
--
Hurd