Exercise 2: Why ext4 Silently Returns Corrupted Data While Btrfs Detects It — Possible Solution ==================================================================== Explanation: Per the chapter, "Btrfs checksums both data and metadata by default. On every read, the checksum is verified" -- when a block has silently corrupted on disk (bit rot, often from a failing disk), Btrfs recomputes the checksum of the data it just read and compares it against the checksum it stored when that data was originally written. If the two don't match, Btrfs knows immediately, on that very read, that the data returned is not what was actually written -- it can report an error or, with redundancy in place, transparently repair it from a good copy instead of ever handing the corrupted data back to the application. ext4 has no equivalent mechanism at all. Per the chapter, "ext4 would just return the corrupted data, unaware anything was wrong" -- ext4's own read path has no stored checksum to compare corrupted blocks against, so there is nothing for it to notice. It reads whatever bytes are physically on disk at the location it expects the data to be, and hands them back exactly as read, with no verification step at all. If those bytes have degraded due to bit rot, ext4 has no way to distinguish "these are the correct bytes" from "these are silently corrupted bytes" -- both look identical to a filesystem that never checks. The root difference is not that Btrfs is somehow better at reading disks -- both filesystems read the same physical bytes a failing disk returns. The difference is that Btrfs stores an independent checksum alongside the data specifically so corruption can be detected after the fact, while ext4 stores no such verification data at all. WHY THIS WORKS AS AN ANSWER ------------------------------ This identifies the specific mechanism (a stored, verified checksum vs. no checksum at all) rather than a vague "Btrfs is more reliable," and explains why the two filesystems behave identically as far as what bytes they physically read, differing only in whether anything checks those bytes against a known-good value afterward.