Skip to content

feat(fs): implement RLIMIT_FSIZE limit checking#1312

Merged
fslongjin merged 1 commit intoDragonOS-Community:masterfrom
fslongjin:feat-add-rlimit-fsize
Oct 9, 2025
Merged

feat(fs): implement RLIMIT_FSIZE limit checking#1312
fslongjin merged 1 commit intoDragonOS-Community:masterfrom
fslongjin:feat-add-rlimit-fsize

Conversation

@fslongjin
Copy link
Member

  • 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

Copilot AI review requested due to automatic review settings October 9, 2025 05:53
@github-actions github-actions bot added the enhancement New feature or request label Oct 9, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@fslongjin fslongjin force-pushed the feat-add-rlimit-fsize branch from c0ef399 to 82c3bc9 Compare October 9, 2025 05:57
@fslongjin fslongjin merged commit 7059be4 into DragonOS-Community:master Oct 9, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants