fix: fix chroot and tmpfs#1480
Merged
fslongjin merged 7 commits intoDragonOS-Community:masterfrom Dec 16, 2025
Merged
Conversation
- Introduced new ProcFileType variants for /proc/[pid]/mountinfo and /proc/[pid]/maps. - Implemented content generation for /proc/[pid]/mountinfo and /proc/[pid]/maps to align with Linux semantics. - Updated ProcFS inode creation to include these new files for each process. - Enhanced path handling in the VFS to ensure correct resolution based on process-specific root and current working directory. This addition improves the process filesystem's functionality and compatibility with Linux behavior.
- Added an unevictable flag to the PageCache structure, allowing pages to be marked as unevictable to prevent reclamation. - Updated the TmpfsInode structure to integrate page cache management, replacing direct data manipulation with page cache operations for read and write methods. - Refactored truncate and resize methods to utilize the new page cache functionality, ensuring consistency and improved memory management.
- Implemented support for readahead in tmpfs, allowing for optimized data retrieval. - Added checks for filename length across various VFS operations to prevent errors related to excessively long names. - Updated the tmpfs implementation to handle read and write operations directly through the page cache, improving memory management. - Enhanced rename functionality to ensure type compatibility and empty directory checks during operations. - Increased maximum path length and defined maximum single filename length for better filesystem compliance.
- 将tmpfs跨目录移动逻辑提取为独立函数`tmpfs_move_entry_between_dirs` - 优化锁顺序以避免死锁,按inode_id顺序锁定目录 - 修复MountFSInode::move_to中目标inode解包问题,确保正确委托给底层文件系统 Signed-off-by: longjin <longjin@DragonOS.org>
…page fault handling - Added `create_zero_pages` method to `InnerPageCache` for efficient zero-page creation, optimizing memory usage in tmpfs. - Updated `Tmpfs` to utilize the new zero-page creation during read and write operations, ensuring seamless handling of page faults. - Enhanced `PageFaultHandler` with `pagecache_fault_zero` to manage page faults specifically for tmpfs, allowing for direct page cache access without disk I/O. This improves the performance and reliability of memory file systems by reducing unnecessary allocations and ensuring proper page management.
…_cstr for clarity - Updated the user access module to introduce vfs_check_and_clone_cstr, enhancing clarity in its purpose for VFS operations. - Refactored sys_openat and utimensat to utilize the new vfs_check_and_clone_cstr function, ensuring consistent handling of C string paths across the filesystem.
Member
Author
|
@claude review this PR in Chinese |
|
Claude finished @fslongjin's task in 3m 46s —— View job Claude正在审阅PR #1480
待办清单:
详细审阅报告已全面分析PR #1480 "fix: fix chroot and tmpfs"。以下是详细的代码审阅反馈: ✅ 主要改进
|
220e556 to
9ee0bec
Compare
9ee0bec to
eda72c8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.