Skip to content

fix(node): preserve overlay xattrs across detach and restore - #438

Open
Floating-Y wants to merge 1 commit into
deeplethe:devfrom
Floating-Y:fix/detach-overlay-xattrs
Open

Floating-Y wants to merge 1 commit into
deeplethe:devfrom
Floating-Y:fix/detach-overlay-xattrs

Conversation

@Floating-Y

Copy link
Copy Markdown
Collaborator

Problem

Deleting a template directory and recreating it as an empty directory causes overlayfs to mark it opaque. The detach archive and restore extraction did not preserve these extended attributes, so deleted template files reappeared after restore.

This is separate from #369, which prevents source data deletion when archiving fails.

Changes

  • Preserve trusted.overlay.* and user.overlay.* during both tar creation and extraction.
  • Retain sparse-file support and fix: preserve sandbox data when detach archiving fails #369's process-status checks, temporary archives, atomic publication, and source preservation on failure.
  • Exercise the actual archive/extraction code in regression tests.
  • Add real overlay round trips for both trusted and userxattr modes, with safe cleanup of test mounts and temporary directories.

Validation

  • Before the fix, the attribute regression and both real overlay tests failed.
  • After the fix, all 9 regular detach tests passed.
  • Both real Linux overlay tests explicitly ran as root and passed, confirming deleted template contents remain hidden and newly written data survives.
  • All 17 bundle tests passed.
  • Formatting, Clippy with -D warnings, and git diff --check passed.
  • Sparse-file contents and allocation were preserved through the shared archive/extraction path used by Firecracker.

Limitations

Full gVisor and Firecracker boot end-to-end tests were not run. Existing archives that have already lost overlay attributes cannot be repaired by this change.

@Floating-Y
Floating-Y marked this pull request as ready for review November 2, 2026 03:08

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant