Module 4: File Systems & I/O: Mistake Clinic
This clinic turns wrong moves into reusable judgment. Use it after each practice page and again before the quiz or checkpoint.
Module-Specific Mistake Radar
Start with these traps. Replace or extend them with real mistakes from your own work.
| Mistake to look for | Where it shows up | Symptom | Repair evidence |
|---|---|---|---|
| Finishing File System Internals Workshop with only a final answer | File System Internals Workshop | The work has no failed case, trace, test, proof gap, or design stress point. | Add the smallest broken example and show the repair that changes the result. |
| Finishing Crash Consistency Clinic with only a final answer | Crash Consistency Clinic | The work has no failed case, trace, test, proof gap, or design stress point. | Add the smallest broken example and show the repair that changes the result. |
| Finishing I/O Performance Lab with only a final answer | I/O Performance Lab | The work has no failed case, trace, test, proof gap, or design stress point. | Add the smallest broken example and show the repair that changes the result. |
| Finishing Code Katas: FUSE, fsync, epoll, Recovery with only a final answer | Code Katas: FUSE, fsync, epoll, Recovery | The work has no failed case, trace, test, proof gap, or design stress point. | Add the smallest broken example and show the repair that changes the result. |
| Treating What a File Is: Byte Stream, Metadata, Inodes as vocabulary instead of a tool | What a File Is: Byte Stream, Metadata, Inodes | The explanation names the concept but cannot decide between two cases. | Write one example, one non-example, and the rule that separates them. |
| Treating Directories Are Just Files With Structured Contents as vocabulary instead of a tool | Directories Are Just Files With Structured Contents | The explanation names the concept but cannot decide between two cases. | Write one example, one non-example, and the rule that separates them. |
Practice Mistake Checks
Pull any miss from these checks into your mistake log.
File System Internals Workshop
Source: practice/01-file-system-internals-workshop.md
Identify the error in each statement:
- "
rm foodeletes the data immediately." - "
mv a bin the same directory moves the file's inode." - "
cp a bduplicates the inode." - "An ext4 file with a single extent still requires an indirect block for 1 MiB of data."
- "When two processes open the same file independently, writes through one move the read offset of the other."
- "
close(fd)releases the inode unconditionally." - "A directory's data blocks are only used for quick lookups and can be rebuilt from the inode."
Crash Consistency Clinic
Source: practice/02-crash-consistency-clinic.md
Identify the error in each statement:
- "Journaling doubles all writes."
- "A COW FS cannot be corrupted."
- "
fsyncguarantees the drive has the data." - "
closeimpliesfsync." - "If the kernel issues writes in order, the disk commits them in order."
- "
sync_file_rangeis a fasterfsync." - "Metadata journaling protects user data."
I/O Performance Lab
Source: practice/03-io-performance-lab.md
Identify the error:
- "My workload is fast because I fit in the page cache. So it will be fast in production."
- "
O_DIRECTis always faster for databases." - "Since NVMe has no seek penalty, random and sequential are equivalent."
- "
freeshows little free memory, so I need to add RAM." - "I benchmarked with a warm cache, and the numbers match disk spec-sheet IOPS."
- "I use
sync_file_range, so my data is durable." - "Write-back means my writes are async and free."
Repair Protocol
For each real mistake:
- Reproduce the failure on the smallest example, trace, proof, query, command, or design sketch.
- Name the hidden assumption.
- Repair the artifact.
- Save evidence that changed: failing then passing test, corrected proof step, revised diagram, safer command, benchmark, or review note.
- Add one retrieval card beginning with Check... before... or Do not use... when....
Mistake Log
| Date | Mistake | Symptom | Root cause | Repair evidence | Retrieval card |
|---|---|---|---|---|---|
| Starter | Pick one radar row above | Explain how it would fail in this module | Name the assumption | Add a counterexample or corrected artifact | Write the card before closing the page |
Completion Standard
- At least five real mistakes are logged.
- At least two mistakes include a counterexample or failing test.
- At least one mistake connects to an older semester skill.
- At least one correction changes code, a proof, a diagram, a command transcript, a query, or a design decision.