Hello, Milos Nikic, le mer. 25 juin 2025 14:36:04 -0700, a ecrit: > As a learning and exploration effort, I've started working on a toy journaling > layer inside ext2fs. The goal is to understand how journaling might look in a > user-space filesystem like Hurd’s, and whether it's feasible to implement a > basic journaling mechanism incrementally.
Being userspace probably doesn't really have impact on the implementation of journaling. > So far, I’ve added a non-intrusive skeleton that: > - Hooks into `diskfs_init_diskfs` (for init) and `diskfs_sync_everything` (for > flushing), You'll want to plug at a lower level than diskfs_sync_everything, to catch all data and metadata writes and write to the log ahead of them. For real safety, we will need to introduce write barriers at the device RPC layer. Samuel > - Buffers log entries in memory and flushes to `/tmp/journal.log`, > - Outputs to the screen during boot if writing fails (e.g., due to early boot > or read-only FS), > - Is wrapped in a minimal interface (`journal_log`, `flush_journal_to_file`) > with guards for safety. > > The goal is **not** a production journaling layer, but rather to build a base > to explore correctness, crash safety, and design directions. > > You can see it show up during boot with messages like: > > Toy journaling: journal_init() called > Toy journaling: flushing journal to disk... > > I can also verify the presence of one of the init messages in /tmp/journal.log > > Before proceeding further: > - I'd appreciate any guidance on whether this is being plugged in the right > places. > - Are there preferred conventions or hooks I should be using instead? > - Would you be open to reviewing it as a small patch series while I iterate, > or > should this stay on a branch until it's more mature? > > Thanks in advance for any input — and for the warm welcome so far! > > Best, > Milos Nikic