---
title: "How We Found and Fixed a Filesystem Corruption Bug"
description: "A failed Cedar-14 stack image rollback caused Heroku's container tools to truncate and overwrite a disk image while it was still mounted read-only as dynos' root filesystem."
url: "https://swe.quest/articles/how-we-found-and-fixed-a-filesystem-corruption-bug-ec675d8c1746a0c9"
canonical: "https://www.heroku.com/blog/filesystem-corruption-on-heroku-dynos/"
source: "Heroku Engineering"
published: "2017-02-15"
difficulty: "medium"
kind: "Incident"
reading_minutes: 6
tags: ["incident-response","linux","containers","storage-systems","deployment"]
---

# How We Found and Fixed a Filesystem Corruption Bug

A post on [Heroku Engineering](https://swe.quest/sources/heroku.md), published 2017-02-15, 6 min read, Incident. Original: [https://www.heroku.com/blog/filesystem-corruption-on-heroku-dynos/](https://www.heroku.com/blog/filesystem-corruption-on-heroku-dynos/)

## Summary

A failed Cedar-14 stack image rollback caused Heroku's container tools to truncate and overwrite a disk image while it was still mounted read-only as dynos' root filesystem. A container-tools upgrade had changed checksum filenames and digests, so the safety check that skips already-present images missed the existing image. Because the page cache still held old pages while the backing file was truncated or half-written, newly loaded binaries mixed cached and missing data and segfaulted for about five hours. A loop-mount reproduction shows the effect, and the fix was migrating dynos to fresh hosts and marking installed images read-only on the host.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Incidents & postmortems](https://swe.quest/tags/incident-response.md) (Reliability & operations)
- [Linux](https://swe.quest/tags/linux.md) (Infrastructure)
- [Containers](https://swe.quest/tags/containers.md) (Infrastructure)
- [Storage systems](https://swe.quest/tags/storage-systems.md) (Infrastructure)
- [Deployment](https://swe.quest/tags/deployment.md) (Reliability & operations)

## Prerequisites

- Linux mount and loop devices ([easy posts on Linux](https://swe.quest/tags/linux.md?difficulty=easy))
- page cache basics ([easy posts on Caching](https://swe.quest/tags/caching.md?difficulty=easy))
- containers ([easy posts on Containers](https://swe.quest/tags/containers.md?difficulty=easy))

## Keywords

Heroku, Cedar-14, dynos, ext4, loop mount, page cache

## Related posts

- [Mitigating CVE-2026-31431 (“Copy Fail”) in Docker Engine](https://swe.quest/articles/mitigating-cve-2026-31431-copy-fail-in-docker-engine-74f4660a17411d93.md): Docker · 2026-05-27 · Medium · 6 min read · Sandboxing & isolation, Containers, Linux, Vulnerability research
  CVE-2026-31431 ("Copy Fail") is a Linux kernel flaw in the AF\_ALG algif\_aead module.
- [Root Cause Analysis for Render's Extended Service Disruption on 3/26/24](https://swe.quest/articles/root-cause-analysis-for-render-s-extended-service-disruption-on-3-26-24-236e0e0282db843d.md): Render · 2024-03-29 · Medium · 5 min read · Incidents & postmortems, Resilience, Storage systems, Deployment, Identity & auth
  A faulty control-plane code change on March 26, 2024 restarted every customer and system workload on Render; a feature-flag bug had kept it from running in staging, and test infrastructure differed between environments.
- [From 732 bytes to nowhere: shutting down Copy Fail in production](https://swe.quest/articles/from-732-bytes-to-nowhere-shutting-down-copy-fail-in-production-8dac32664e09abe4.md): Together AI · 2026-04-30 · Medium · 4 min read · Vulnerability research, Linux, Multi-tenancy, Incidents & postmortems, Security
  Copy Fail (CVE-2026-31431) is a logic bug in the Linux kernel's algif\_aead AF\_ALG interface.
- [Data Loss: a sad tale with a happy ending](https://swe.quest/articles/data-loss-a-sad-tale-with-a-happy-ending-94994cb503d66c03.md): Replit · 2021-09-10 · Medium · 4 min read · Incidents & postmortems, Storage systems, Go, Debugging, Linux
  Replit silently lost or corrupted user repl data for months.
- [Break Stuff on Purpose](https://swe.quest/articles/break-stuff-on-purpose-87dc2221ffb9f4a6.md): Slack Engineering · 2024-12-10 · Medium · 5 min read · Chaos engineering, Incidents & postmortems, Observability, SRE
  Slack's internal Kibana cluster failed in January 2024 after running out of disk, a consequence of co-locating its Elasticsearch storage on the same hosts as the application.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
