feat(vfs): support bind mount reconfiguration#1809
feat(vfs): support bind mount reconfiguration#1809fslongjin merged 5 commits intoDragonOS-Community:masterfrom
Conversation
Allow MS_BIND|MS_REMOUNT to update per-mount flags on existing bind mounts, including readonly enforcement on wrapped mount inodes. Also preserve subtree roots when creating bind mounts and add C unit tests covering readonly bind remount and subdirectory bind behavior. Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>
|
@claude review |
PR Review: feat(vfs): support bind mount reconfigurationI've reviewed the changes in this PR. Overall, the implementation looks solid and adds important functionality for bind mount reconfiguration. Below is my detailed review. Todo list:
Summary of ChangesThe PR adds support for Key Changes:
Positive Aspects✅ Good architectural design – preserving subtree roots via Potential Issues and Suggestions1. Missing Validation in
|
Handle MS_BIND|MS_REMOUNT before applying default mount flags so bind remount only uses explicitly requested per-mount options. Keep the existing atime mode when userspace does not specify a new atime policy, matching Linux bind-remount semantics and avoiding an accidental fallback to relatime. Add a c_unitest regression test that checks noatime is preserved across a readonly bind remount by inspecting /proc/self/mounts. Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>
🔍 自动化代码审查报告 — PR #1809
🔴 [HIGH] Missing mount-root check in
|
Validate MS_BIND|MS_REMOUNT targets against mount roots, update mount flags atomically under a single write lock, and align atime handling with Linux by clearing stale atime bits without persisting strictatime. Fix subdir bind mount root detection to use root_inner_inode and enforce readonly checks on write_sync and setxattr paths. Add dunitest coverage for readonly bind remounts, subtree bind roots, non-root remount rejection, xattr writes on readonly mounts, and strictatime/noatime remount behavior. Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>
Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>
- Rename file extension from .c to .cc - Replace custom test macros with gtest assertions - Convert test functions to gtest test cases - Update main function to use gtest runner - Add test to whitelist for execution Signed-off-by: longjin <longjin@DragonOS.org>
Allow MS_BIND|MS_REMOUNT to update per-mount flags on existing bind
mounts, including readonly enforcement on wrapped mount inodes.
Also preserve subtree roots when creating bind mounts and add C unit
tests covering readonly bind remount and subdirectory bind behavior.