Skip to content

Info drop internal xattrs - #288

Draft
cgwalters wants to merge 3 commits into
composefs:mainfrom
cgwalters:info-drop-internal-xattrs
Draft

cgwalters wants to merge 3 commits into
composefs:mainfrom
cgwalters:info-drop-internal-xattrs

Conversation

@cgwalters

Copy link
Copy Markdown
Contributor

@alexlarsson I took a pass at #282 (comment) (this is only 76.3% baked, I got a little lost a few times in the quoting/processing here) but I'm pretty sure now what we've been writing into the EROFS blob is wrong. If I'm right about that...I think there's two options:

  • Try to roll out our format version 1.1 game plan
  • Just ignore it...how much do we really care about the user. namespace given that we can't mount an EROFS unprivileged anyways and that's super unlikely to change in the future?

cgwalters added 3 commits May 27, 2024 20:43
This exercises edge cases in the dumpfile.

Signed-off-by: Colin Walters <[email protected]>
Tracing through these xattrs, I found it helpful to have
comments with the expansion.

Signed-off-by: Colin Walters <[email protected]>
The roundtrip test currently fails with `special.dump`; I
think this patch is in the right direction but...I think
what we were writing into the EROFS superblock for the
userxattr is wrong...which means fixing this in the obvious
way is a format break.

Signed-off-by: Colin Walters <[email protected]>
@alexlarsson

alexlarsson commented May 28, 2024 •

Copy link
Copy Markdown
Collaborator

I'm not sure we're actually wrong here. But these things are mind-bending, so maybe I'm mistaken.

Here is the situation this is targeting: We have an "image" that contains a traditional whiteout node. We want to create an erofs+overlayfs from this, such that when it is mounted (by root), the resulting file in the mount:
a) Is not swallowed by the cfs overlayfs mount
b) Is usable as a whiteout in a rootful overlayfs where the lowerdir is on the cfs mount
c) Is usable as a whiteout in a userxattr overlayfs where the lowerdir is on the cfs mount

Now, lets focus on c. In the erofs image we create a regular file with the "user.overlay.whiteout" xattr set. Since the composefs overlayfs is rootful, this xattr is passed on as-is and works as a xwhiteout for a second userxattr mount. However, it needs the parent directory to be marked for overlayfs to handle it. So, we set "user.overlay.opaque" to "x" to mark this. This xattr also is not touched by the composefs overlay mount, so it is available as-is for the second level userxattr overlayfs mount.

I think maybe you misunderstood the reason for these xattrs. They are not because we want to mount the erofs image with userxattrs (that will not work for many reasons), but rather that the rootful overlayfs mount of the erofs image should produce a mount where the whiteout file is useful both for regular and userxattr mounts.

@alexlarsson

Copy link
Copy Markdown
Collaborator

Question though, should we convert an xwhiteout to a regular whiteout when we dump?

@cgwalters

Copy link
Copy Markdown
Contributor Author

but rather that the rootful overlayfs mount of the erofs image should produce a mount where the whiteout file is useful both for regular and userxattr mounts.

Right! That makes sense.

@cgwalters

Copy link
Copy Markdown
Contributor Author

The first commit got reimplemented a different way.

I pushed the second commit to #384

This PR is going to need some nontrivial thought at some point, but isn't critical.

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.

2 participants