virtiofs: Fix writable virtiofs mounts#75
Conversation
Regression from previous commit; we unconditionally added `--readonly` if virtiofsd supported it (which it doesn't yet in the Ubuntu 24.04 but does in Fedora 42+). We want to support writable mounts. It turns out the integration tests didn't catch this because they only looked at the permission bits. Signed-off-by: Colin Walters <walters@verbum.org>
Summary of ChangesHello @cgwalters, 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 a critical regression that inadvertently made virtiofs mounts read-only in certain scenarios, hindering expected functionality. The core change involves introducing explicit control over the read-only behavior of virtiofs mounts through a new configuration flag. This ensures that mounts are writable by default unless specifically configured otherwise. Accompanying this fix are updated integration tests that now thoroughly validate both read-only and writable mount operations, providing robust coverage against similar issues. Highlights
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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request fixes a regression that caused all virtiofs mounts to be read-only, even when they were intended to be writable. The core fix correctly adds the --readonly flag to virtiofsd only when a read-only mount is explicitly requested.
I appreciate the accompanying changes to the integration tests. Merging the two test helper functions into one and, more importantly, changing the tests to verify writability by actually attempting to write a file is a great improvement that will prevent similar regressions in the future.
I have one suggestion in the test code to improve robustness against special characters, but overall the changes are excellent and directly address the issue. Well done.
Regression from previous commit; we unconditionally added
--readonlyif virtiofsd supported it (which it doesn't yet in the Ubuntu 24.04 but does in Fedora 42+).We want to support writable mounts.
It turns out the integration tests didn't catch this because they only looked at the permission bits.