feat(vfs): implement pivot_root for mount namespaces#1810
feat(vfs): implement pivot_root for mount namespaces#1810sparkzky wants to merge 5 commits intoDragonOS-Community:masterfrom
Conversation
Add pivot_root(2) support for mount namespaces, including mount list path rewrites, namespace-root handling, and rebinding of process fs root and cwd after namespace switches. Also fix mount-root path resolution and umount path lookup for moved mount trees, and add C unit tests covering pivot_root behavior. Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>
|
@claude review |
|
Claude finished @sparkzky's task in 9m 58s —— View job Claude's PR Review I've reviewed the Overall Assessment
Key Observations1. Propagation Check ScopeIn 2. Unsafe Pointer Casts for MutabilityIn
Suggestion: Move 3. Root Mount Self‑Mountpoint CheckThe code requires 4. Path Rewriting LogicThe 5. Task Iteration in
|
|
测例加到dunitest下面,这个会自动运行。 |
Signed-off-by: sparkzky <sparkhhhhhhhhhh@outlook.com>
- 修复挂载传播时未同步更新目标命名空间的mount_list,导致copy_mnt_ns时mountpoints 与mount_list不同步 - 修复clone(CLONE_NEWNS)后子进程的root/pwd未切换到新命名空间的根inode - 移除umount2中的调试日志 - 添加pivot_root的完整测试套件,包括共享挂载拒绝、命名空间隔离和双重pivot测试 Signed-off-by: longjin <longjin@DragonOS.org>
Add pivot_root(2) support for mount namespaces, including mount list
path rewrites, namespace-root handling, and rebinding of process fs root
and cwd after namespace switches.
Also fix mount-root path resolution and umount path lookup for moved
mount trees, and add C unit tests covering pivot_root behavior.