Skip to main content

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 forWhere it shows upSymptomRepair evidence
Finishing File System Internals Workshop with only a final answerFile System Internals WorkshopThe 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 answerCrash Consistency ClinicThe 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 answerI/O Performance LabThe 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 answerCode Katas: FUSE, fsync, epoll, RecoveryThe 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 toolWhat a File Is: Byte Stream, Metadata, InodesThe 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 toolDirectories Are Just Files With Structured ContentsThe 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:

  1. "rm foo deletes the data immediately."
  2. "mv a b in the same directory moves the file's inode."
  3. "cp a b duplicates the inode."
  4. "An ext4 file with a single extent still requires an indirect block for 1 MiB of data."
  5. "When two processes open the same file independently, writes through one move the read offset of the other."
  6. "close(fd) releases the inode unconditionally."
  7. "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:

  1. "Journaling doubles all writes."
  2. "A COW FS cannot be corrupted."
  3. "fsync guarantees the drive has the data."
  4. "close implies fsync."
  5. "If the kernel issues writes in order, the disk commits them in order."
  6. "sync_file_range is a faster fsync."
  7. "Metadata journaling protects user data."

I/O Performance Lab

Source: practice/03-io-performance-lab.md

Identify the error:

  1. "My workload is fast because I fit in the page cache. So it will be fast in production."
  2. "O_DIRECT is always faster for databases."
  3. "Since NVMe has no seek penalty, random and sequential are equivalent."
  4. "free shows little free memory, so I need to add RAM."
  5. "I benchmarked with a warm cache, and the numbers match disk spec-sheet IOPS."
  6. "I use sync_file_range, so my data is durable."
  7. "Write-back means my writes are async and free."

Repair Protocol

For each real mistake:

  1. Reproduce the failure on the smallest example, trace, proof, query, command, or design sketch.
  2. Name the hidden assumption.
  3. Repair the artifact.
  4. Save evidence that changed: failing then passing test, corrected proof step, revised diagram, safer command, benchmark, or review note.
  5. Add one retrieval card beginning with Check... before... or Do not use... when....

Mistake Log

DateMistakeSymptomRoot causeRepair evidenceRetrieval card
StarterPick one radar row aboveExplain how it would fail in this moduleName the assumptionAdd a counterexample or corrected artifactWrite 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.