Read first
docs/architecture/storage: how disks are named, claimed, queued and timed outdocs/architecture/filesystem: mounts, ext4 profile, seals, caches, writeback, imagesdocs/architecture/crash-recovery: the journal, commit ordering, the at-rest markdocs/architecture/usb: USB sticks as disks
Rules a change must keep
- A transport implements only
QueueOps. Slots, retry, timeout, quarantine
and the write fence stay in block/engine.rs; nothing allocates on the
request path.
- Quarantined pages and tags are the device's until it completes them.
- A claim carries its disk's generation; a disk's nodes appear only once its
partition table is in place; a block node's inode is never reused.
- Build
/dev/disk/by-idnames only inboot_core::disk_id, never in a driver. ext4-core/profileis the one statement of the ext4 features, held to
what the kernel writes.
- Keep the four
EXT4_POOL_<n>lock classes separate: a path walk holds one
mount's lock while taking the next. Unmount must release the claim.
- A path that changes an inode record or a directory without
Ext4Fs::write_inode_num or the dir entry helpers must bump the dcache
generation counters itself.
- Every mutation goes through
Ext4Fs::transaction, which re-marks the
volume in use first. In use: needs_recovery before the journal goes
live. At rest: journal emptied before the flag is cleared.
- Metadata reaches the journal before its home, file data its home before
the commit naming it, a commit block only behind a flush. A freed block
is not reallocated until the free is durable.
- Replay writes nothing home until every committed copy has checked out.
- Writeback is the mount's one pass, in
WRITEBACK_CHUNKsteps with the
mount lock released between them.
build_fs_image.shnever deletes aPRESERVE_FS_IMAGE=1image; it stops
and names the repair. Only just reset root discards one.
Checks
just test-host:ext4-core,nvme-core,boot-coreon the hostjust test 'slopos_fs::*': the kernel's filesystem testsjust check-fs-image: a suite's image passese2fsck -fnand is at restjust test-persist: an fsynced file survives a power-offjust test-rude-exit: hoste2fsckreplays what the kernel committedjust test-capacity: a large volume's mount and write costjust check-capture:run_tests gate fsperfover a suite capture
Not yet in the docs
Read pending.md beside this file when it exists. A change that adds or alters an invariant the docs do not state appends it there in the same commit.