You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[SUBISSUE #3] Implement Dynamic Mount Management and Root Switching (mount, umount2, chroot, pivot_root) #297
kernel/fs/Vfs.hpp & kernel/fs/Vfs.cpp: Support dynamic unmounting (vfs_umount, returning -EBUSY when open files/active mounts remain unless MNT_DETACH), remount flags (MS_REMOUNT), and per-process root-dentry resolution in vfs_namei().
kernel/process/Process.hpp & kernel/process/Process.cpp: Track per-process root path/dentry (inherited across fork/execve) so chroot scopes absolute path lookups cleanly.
kernel/syscalls/FileSyscalls.cpp & SyscallDispatcher.cpp: Implement and dispatch sys_umount2 (39), sys_mount (40, supporting tmpfs, devfs, ext2), sys_pivot_root (41), and sys_chroot (51).
tests/host/ & kernel/shell/tests/: Add host ASan/UBSan and QEMU tests for mounting/unmounting tmpfs & ext2, EBUSY checks, chroot isolation (.. clamped at chroot root), and zero VFS/PFA leaks.
Out of scope: per-process mount namespaces (CLONE_NEWNS / unshare — evaluated in Phase 6).
Acceptance Criteria & Edge Cases
mount mounts a new tmpfs (or ext2 block device) at an existing directory and umount2 cleanly reclaims all superblock/dentry/inode/PFA resources
umount2 returns -EBUSY when a file inside the mount is still open and -EINVAL for non-mountpoint paths
chroot updates the process root so /.. cannot escape the chroot boundary; pivot_root atomically swaps root and put_old mounts
make format && make clean-tests && make -j"$(nproc)" all && make -j"$(nproc)" quality passes with zero warnings
Activity