-
Notifications
You must be signed in to change notification settings - Fork 305
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
WIP/DNM / Support overlayfs whiteout character files #2713
Conversation
Hi @mangelajo. Thanks for your PR. I'm waiting for a ostreedev member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/hold I'd like to push back on this, I don't think it is a good idea. The thread at #2712 is still ongoing, let's find better alternatives there. |
729ecf6
to
49077e9
Compare
please participate on the thread and provide alternatives, and please elaborate why you think it's not a good idea. |
I'll let @cgwalters drive the conversation there to avoid too many voices, but I pretty much share the hints in #2712 (comment). |
49077e9
to
ecd0a0f
Compare
src/libostree/ostree-core.c
Outdated
@@ -2014,7 +2014,7 @@ file_header_parse (GVariant *metadata, | |||
mode = GUINT32_FROM_BE (mode); | |||
g_autoptr(GFileInfo) ret_file_info = _ostree_mode_uidgid_to_gfileinfo (mode, uid, gid); | |||
|
|||
if (S_ISREG (mode)) | |||
if (S_ISREG (mode) || S_ISCHR(mode)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should have a common helper that checks specifically for whiteouts, which needs to take either a GFileInfo
or a struct stat
.
We still do want to error out for any character devices that are not whiteouts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes in this case we are reconstructing the info from the ostree data and we have a check in L2009 that verifies rdev==0, so that´s assumed down here.
We could put the rdev info back into the GFileInfo and then have a validator to make it more explicit.
src/libostree/ostree-repo.c
Outdated
@@ -4474,7 +4475,7 @@ ostree_repo_load_file (OstreeRepo *self, | |||
if (S_ISLNK (stbuf.st_mode)) | |||
g_file_info_set_symlink_target (*out_file_info, symlink_target); | |||
else | |||
g_assert (S_ISREG (stbuf.st_mode)); | |||
g_assert (S_ISREG (stbuf.st_mode) || (S_ISCHR(stbuf.st_mode) && stbuf.st_rdev == 0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the check we want to generalize everywhere I think, as e.g. _ostree_is_whiteout (&stbuf)
.
/ok-to-test |
I do want to note here the last bit of #2712 (comment)
which is that we could land this in ostree and that would probably work for your use case, but all that code that lives in ostree-rs-ext, such as e.g. And that gets into the whole topic of being able to "nest" container storage layers in container layers, which I think we do want longer term, which leads to #2712 (comment) or so. |
src/libostree/ostree-core.c
Outdated
@@ -2014,7 +2014,7 @@ file_header_parse (GVariant *metadata, | |||
mode = GUINT32_FROM_BE (mode); | |||
g_autoptr(GFileInfo) ret_file_info = _ostree_mode_uidgid_to_gfileinfo (mode, uid, gid); | |||
|
|||
if (S_ISREG (mode)) | |||
if (S_ISREG (mode) || S_ISCHR(mode)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes in this case we are reconstructing the info from the ostree data and we have a check in L2009 that verifies rdev==0, so that´s assumed down here.
We could put the rdev info back into the GFileInfo and then have a validator to make it more explicit.
@@ -2368,7 +2385,7 @@ _ostree_validate_bareuseronly_mode (guint32 content_mode, | |||
return glnx_throw (error, "Content object %s: invalid mode 0%04o with bits 0%04o", | |||
checksum, content_mode, invalid_modebits); | |||
} | |||
else if (S_ISLNK (content_mode)) | |||
else if (S_ISLNK (content_mode) || S_ISCHR(content_mode)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't use the helper functions here since at this point it's only mode
@@ -2400,7 +2417,7 @@ gboolean | |||
ostree_validate_structureof_file_mode (guint32 mode, | |||
GError **error) | |||
{ | |||
if (!(S_ISREG (mode) || S_ISLNK (mode))) | |||
if (!(S_ISREG (mode) || S_ISLNK (mode) || S_ISCHR(mode))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here.
@@ -301,7 +332,7 @@ commit_loose_regfile_object (OstreeRepo *self, | |||
return FALSE; | |||
} | |||
else | |||
g_assert (S_ISLNK (mode)); | |||
g_assert (S_ISLNK (mode) || S_ISCHR(mode)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here.
25f2623
to
11a4e2b
Compare
11a4e2b
to
c2ff1cc
Compare
I'm working on another PR that follows the other suggested approach. |
/* Otherwise, fall through and do the link, we should | ||
* get EEXIST. | ||
*/ | ||
/* Otherwise, fall through and do the link, we should |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change shouldn't be here
Dropping this approach in favor of #2717 |
This is yet incomplete and untested, it doesn't work yet.
Related-Issue: #2712