Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

erofs: Escape overlayfs features #175

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

alexlarsson
Copy link
Collaborator

@alexlarsson alexlarsson commented Aug 17, 2023

This escapes overlayfs xattrs and whiteouts according to the support in this patch series:
https://lore.kernel.org/linux-unionfs/cover.1692198910.git.alexl@redhat.com/

Note: We should probably wait with merging this until we have more feedback on the kernel list about it.

Fixes #172

@alexlarsson
Copy link
Collaborator Author

We should probably also add an escaped xattr to one of the test images.

@cgwalters cgwalters added enhancement New feature or request blocked This issue is waiting on something external labels Aug 21, 2023
@cgwalters cgwalters marked this pull request as draft August 21, 2023 14:55
@cgwalters
Copy link
Contributor

Note: We should probably wait with merging this until we have more feedback on the kernel list about it.

Yeah makes sense; moved to draft for that reason

This escapes overlayfs xattrs and whiteouts according to the support
in this patch series:
  https://lore.kernel.org/linux-unionfs/cover.1692198910.git.alexl@redhat.com/

Signed-off-by: Alexander Larsson <alexl@redhat.com>
@alexlarsson
Copy link
Collaborator Author

Patch series 4 is more or less acked, so lets get this in

Copy link
Contributor

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sane, but I didn't sanity check this versus the kernel APIs.

Also, we will clearly want some integration tests for this in the future.


if (str_has_prefix(name, "trusted.overlay.")) {
cleanup_free char *renamed =
str_join("trusted.overlay.overlay.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really worth carrying str_join over just asprintf ("trusted.overlay.overlay.%s", name + strlen("trusted.overlay.")) ?


lcfs_node_set_mode(node,
S_IFREG | (lcfs_node_get_mode(node) & ~S_IFMT));
ret = lcfs_node_set_xattr(node, "trusted.overlay.overlay.whiteout",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional future cleanup: we could have a linux-overlayfs-internals.h header that includes #defines that link to the upstream source code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might look at extracting this. Although we can't use the kernel headers here, the way the xattr defines are structured in the kernel is a bit weird.

@cgwalters cgwalters removed the blocked This issue is waiting on something external label Sep 13, 2023
@alexlarsson
Copy link
Collaborator Author

Yeah, I plan to land all the outstanding stuff, and then do work on adding more tests in general.

@alexlarsson alexlarsson merged commit a4c4e88 into containers:main Sep 13, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

handle nested whiteouts
2 participants