-
Notifications
You must be signed in to change notification settings - Fork 3.8k
oci: partially restore comment on read-only mounts for uid/gid uses #8397
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
Conversation
Commit cab0562 removed the tryReadonlyMounts utility, in favor of mounts.ReadOnlyMounts() that was added in commit daa3a76. That change made part of the comment redundant, because mounts.ReadOnlyMounts handles both overlayfs read-only mounts (by skipping the workdir mounts), and sets the "ro" option for other mount-types, but the reason why we're using a read-only mount is still relevant, so restoring that part of the comment. Signed-off-by: Sebastiaan van Stijn <[email protected]>
| // Use a read-only mount when trying to get user/group information | ||
| // from the container's rootfs. Since the option does read operation | ||
| // only, we append ReadOnly mount option to prevent the Linux kernel | ||
| // from syncing whole filesystem in umount syscall. |
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.
@fuweid let me know if this is enough to restore, or if the second half (the TODO) of the original comment is still relevant in some cases;
// TODO(fuweid):
//
// Currently, it only works for overlayfs. I think we can apply it to other
// kinds of filesystem. Maybe we can return `ro` option by `snapshotter.Mount`
// API, when the caller passes that experimental annotation
// `containerd.io/snapshot/readonly.mount` something like that.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.
Thanks! It looks good to me.
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.
Thanks! Wanted to be sure if there wasn't some case I overlooked
fuweid
left a comment
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.
LGTM
| // Use a read-only mount when trying to get user/group information | ||
| // from the container's rootfs. Since the option does read operation | ||
| // only, we append ReadOnly mount option to prevent the Linux kernel | ||
| // from syncing whole filesystem in umount syscall. |
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.
Thanks! It looks good to me.
ReadonlyMountsto make overlay mounts readonly #8259Commit cab0562 removed the tryReadonlyMounts utility, in favor of mounts.ReadOnlyMounts() that was added in commit daa3a76.
That change made part of the comment redundant, because mounts.ReadOnlyMounts handles both overlayfs read-only mounts (by skipping the workdir mounts), and sets the "ro" option for other mount-types, but the reason why we're using a read-only mount is still relevant, so restoring that part of the comment.