{"id":19327,"date":"2017-10-23T16:03:12","date_gmt":"2017-10-23T20:03:12","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=19327"},"modified":"2017-10-23T16:04:53","modified_gmt":"2017-10-23T20:04:53","slug":"how-well-do-filesystems-handle-errors","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2017\/10\/23\/how-well-do-filesystems-handle-errors\/","title":{"rendered":"How Well Do Filesystems Handle Errors?"},"content":{"rendered":"<p><a href=\"https:\/\/danluu.com\/filesystem-errors\/\">Dan Luu<\/a> (<a href=\"https:\/\/twitter.com\/danluu\/status\/922499198121074689\">tweet<\/a>, <a href=\"https:\/\/news.ycombinator.com\/item?id=15534460\">Hacker News<\/a>):<\/p>\n<blockquote cite=\"https:\/\/danluu.com\/filesystem-errors\/\"><p>We&rsquo;re going to reproduce some <a href=\"\/\/danluu.com\/file-consistency\/\">results from papers on filesystem robustness that were written up roughly a decade ago<\/a>: <a href=\"http:\/\/research.cs.wisc.edu\/wind\/Publications\/iron-sosp05.pdf\">Prabhakaran et al. SOSP 05 paper<\/a>, which injected errors below the filesystem and  <a href=\"https:\/\/www.usenix.org\/legacy\/event\/fast08\/tech\/full_papers\/gunawi\/gunawi_html\/index.html\">Gunawi et al. FAST 08<\/a>, which looked at how often filessytems failed to check return codes of functions that can return errors.<\/p>\n<p>[&#8230;]<\/p>\n<p>No tested filesystem other than <tt>btrfs<\/tt> handled silent failures correctly. The other filesystems tested neither duplicate nor checksum data, making it impossible for them to detect silent failures. <tt>zfs<\/tt> would probably also handle silent failures correctly but wasn&rsquo;t tested. <tt>apfs<\/tt>, despite post-dating <tt>btrfs<\/tt> and <tt>zfs<\/tt>, made the explicit decision to not checksum data and silently fail on silent block device errors.<\/p>\n<p>[&#8230;]<\/p>\n<p>Relatedly, it appears that <a href=\"http:\/\/dtrace.org\/blogs\/ahl\/2016\/06\/19\/apfs-part5\/\"><tt>apfs<\/tt> doesn&rsquo;t checksum data because &ldquo;[apfs] engineers contend that Apple devices basically don&rsquo;t return bogus data&rdquo;<\/a>. Publicly available studies on SSD reliability have not found that there&rsquo;s a model that doesn&rsquo;t sometimes return bad data. It&rsquo;s a common conception that SSDs are less likely to return bad data than rotational disks[&#8230;]<\/p><\/blockquote>\n<p>Plus, APFS can be used on non-Apple SSDs as well as on hard drives, so there&rsquo;s <em>really<\/em> no reason to believe that checksums wouldn&rsquo;t detect errors.<\/p>\n<p>Previously: <a href=\"https:\/\/mjtsai.com\/blog\/2016\/06\/17\/apple-file-system-apfs\/\">Apple File System (APFS)<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Dan Luu (tweet, Hacker News): We&rsquo;re going to reproduce some results from papers on filesystem robustness that were written up roughly a decade ago: Prabhakaran et al. SOSP 05 paper, which injected errors below the filesystem and Gunawi et al. FAST 08, which looked at how often filessytems failed to check return codes of functions [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[1395,1321,537,31,1472,448,30,1529,174],"class_list":["post-19327","post","type-post","status-publish","format-standard","hentry","category-technology","tag-apple-file-system-apfs","tag-data-integrity","tag-filesystem","tag-ios","tag-ios-11","tag-linux","tag-mac","tag-macos-10-13","tag-storage"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/19327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=19327"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/19327\/revisions"}],"predecessor-version":[{"id":19328,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/19327\/revisions\/19328"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=19327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=19327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=19327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}