{"id":52067,"date":"2026-06-02T14:13:37","date_gmt":"2026-06-02T18:13:37","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=52067"},"modified":"2026-06-02T14:13:37","modified_gmt":"2026-06-02T18:13:37","slug":"fsck_hfs-cache-exhaustion-bug","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2026\/06\/02\/fsck_hfs-cache-exhaustion-bug\/","title":{"rendered":"fsck_hfs Cache Exhaustion Bug"},"content":{"rendered":"<p><a href=\"https:\/\/medium.com\/@kivancgunalp\/i-found-a-bug-in-apples-fsck-hfs-here-s-how-i-tracked-it-down-edc782ce5cf9\">K&#x131;van&ccedil; G&uuml;nalp<\/a>:<\/p>\n<blockquote cite=\"https:\/\/medium.com\/@kivancgunalp\/i-found-a-bug-in-apples-fsck-hfs-here-s-how-i-tracked-it-down-edc782ce5cf9\">\n<p><code>fsck_hfs<\/code> in macOS Sequoia (version hfs-683.x) has a cache exhaustion bug that reports false corruption on large HFS+ volumes. On machines with 8 GB RAM, volumes of 24 TB or larger trigger &ldquo;Couldn&rsquo;t read node&rdquo; errors during the extended attributes check.<\/p>\n<p>[&#8230;]<\/p>\n<p><code>fsck_hfs<\/code> pre-allocates a cache at startup &mdash; a pool of 32KB blocks used for all disk reads. The size of this pool is determined by available system RAM[&#8230;]<\/p>\n<p>[&#8230;]<\/p>\n<p><code>BTCheckUnusedNodes<\/code> races through tens of thousands of free nodes, and every unique disk offset it touches gets a <code>Tag_t<\/code> structure allocated via <code>calloc<\/code> and inserted into the cache&rsquo;s hash table. Each tag claims one 32KB buffer from the pool. When the release path runs, it returns the tag to the LRU list &mdash; but the LRU management doesn&rsquo;t keep up with the rate of allocations.<\/p>\n<p><\/p>\n<p>[&#8230;]<\/p>\n<p>The irony: a function designed to verify filesystem integrity is itself broken &mdash; reporting phantom corruption on perfectly valid volumes.<\/p>\n<\/blockquote>\n\n<p>I&rsquo;m surprised that we keep seeing new HFS+ bugs. I would have thought that code would be frozen by now.<\/p>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2026\/02\/19\/macos-26-4-beta-problems-mounting-hfs-volumes\/\">macOS 26.4 Beta: Problems Mounting HFS+ Volumes<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2025\/05\/13\/macos-15-5\/\">macOS 15.5<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>K&#x131;van&ccedil; G&uuml;nalp: fsck_hfs in macOS Sequoia (version hfs-683.x) has a cache exhaustion bug that reports false corruption on large HFS+ volumes. On machines with 8 GB RAM, volumes of 24 TB or larger trigger &ldquo;Couldn&rsquo;t read node&rdquo; errors during the extended attributes check. [&#8230;] fsck_hfs pre-allocates a cache at startup &mdash; a pool of 32KB [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2026-06-02T18:13:40Z","apple_news_api_id":"71ad13e6-95d8-464f-80ee-a6871a22979b","apple_news_api_modified_at":"2026-06-02T18:13:40Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/Aca0T5pXYRk-A7qaHGiKXmw","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":[131,2670,30,2598,174],"class_list":["post-52067","post","type-post","status-publish","format-standard","hentry","category-technology","tag-bug","tag-hfs-plus","tag-mac","tag-macos-15-sequoia","tag-storage"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/52067","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=52067"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/52067\/revisions"}],"predecessor-version":[{"id":52068,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/52067\/revisions\/52068"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=52067"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=52067"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=52067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}