feat(fs): implement RLIMIT_FSIZE limit checking#1312
Merged
fslongjin merged 1 commit intoDragonOS-Community:masterfrom Oct 9, 2025
Merged
feat(fs): implement RLIMIT_FSIZE limit checking#1312fslongjin merged 1 commit intoDragonOS-Community:masterfrom
fslongjin merged 1 commit intoDragonOS-Community:masterfrom
Conversation
Member
fslongjin
commented
Oct 9, 2025
- Add file size limit checking before write operations
- Send SIGXFSZ signal when exceeding file size limit
- Handle partial writes when approaching the limit
- Add check for O_PATH file descriptors in writeable method
- Update test configurations for write limit tests
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements RLIMIT_FSIZE (file size limit) checking in the filesystem layer to enforce maximum file sizes and handle limit violations according to POSIX standards.
- Adds file size limit validation before write operations with SIGXFSZ signal handling
- Implements partial write support when approaching file size limits
- Enhances file descriptor validation to reject O_PATH descriptors for write operations
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| user/apps/tests/syscall/gvisor/whitelist.txt | Enables write_test in the gvisor test suite |
| user/apps/tests/syscall/gvisor/blocklists/write_test | Adds blocklist for write tests that fail due to missing system calls |
| kernel/src/process/mod.rs | Sets default RLIMIT_FSIZE value to unlimited (u64::MAX) |
| kernel/src/filesystem/vfs/file.rs | Implements RLIMIT_FSIZE checking in write operations and O_PATH validation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
- Add file size limit checking before write operations - Send SIGXFSZ signal when exceeding file size limit - Handle partial writes when approaching the limit - Add check for O_PATH file descriptors in writeable method - Update test configurations for write limit tests Signed-off-by: longjin <longjin@DragonOS.org>
c0ef399 to
82c3bc9
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.