mirror of
https://github.com/agent-substrate/substrate.git
synced 2026-11-13 10:43:28 +08:00
#### 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.