Files
substrate/cmd
Lucky Abolorunke ad830889ad microvm: exclude overlay workdirs from rootfs snapshots (#1030)
#### microvm: Exclude Overlay Workdirs from Rootfs Snapshots

With `index=off` pinned on the merged rootfs mount, a restored workdir
is inert: overlayfs wipes and rebuilds it at mount time, and staging
recreates the directory regardless.

Archiving `<cid>/work` was therefore dead weight on the suspend path—and
not always trivial weight, since a copy-up in flight at pause can leave
file-sized temporary data there.

---

#### Key Changes:

* **`tarutil.CreateFiltered`**: Added a skip predicate over `Create`
(skipping a directory prunes its entire subtree).
* **Workdir Pruning**: Drops exactly the second-level `work` entries
during snapshot archive creation.
* **Backward Compatibility**: Extraction logic remains unchanged;
existing snapshots containing `workdir` entries will still restore
without issue.

---

> **Follow-up to #846 review note:** With `index=off` pinned, a restored
workdir is inert and overlayfs rebuilds it at mount, making its archival
unnecessary overhead on the suspend path.
2026-08-17 18:17:47 -07:00
..