libcrun: fall back to bind mount for /dev/console on read-only file systems#2061
libcrun: fall back to bind mount for /dev/console on read-only file systems#2061giuseppe merged 1 commit intocontainers:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an issue where container terminal setup would fail on read-only root filesystems if Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request addresses an issue where libcrun failed to set up a terminal on a read-only root filesystem when /dev/console could not be unlinked. The changes introduce a fallback mechanism in libcrun_set_terminal to bind mount the PTY to /dev/console if an EROFS error occurs during the unlink operation. A new test case, test_terminal_readonly_rootfs_no_dev_tmpfs, has been added to verify this behavior by simulating a container with a read-only rootfs and no /dev tmpfs. There is no feedback to provide as no review comments were made.
…ystems Commit 405d2a2 changed /dev/console setup to use unlink+symlink instead of a bind mount when mount_dev_from_host is false. When the rootfs is read-only and /dev is not a separate tmpfs mount, unlink fails with EROFS. Fall back to the original bind mount approach when unlink returns EROFS. Closes: containers#1745 Signed-off-by: Jindrich Novy <jnovy@redhat.com>
fc423c6 to
4c530d4
Compare
Commit 405d2a2 changed /dev/console setup to use unlink+symlink instead
of a bind mount when mount_dev_from_host is false. When the rootfs is
read-only and /dev is not a separate tmpfs mount, unlink fails with EROFS.
Fall back to the original bind mount approach when unlink returns EROFS.
Closes #1745