Summary: | copy_file_range does not copy all the way to RLIMIT_FSIZE | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Alan Somers <asomers> | ||||
Component: | kern | Assignee: | Alan Somers <asomers> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | CC: | kib, markj, rmacklem | ||||
Priority: | --- | Flags: | asomers:
mfc-stable13+
asomers: mfc-stable12- |
||||
Version: | CURRENT | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Alan Somers
2022-09-25 17:40:33 UTC
I think yes it should be done. Would you handle this? Sure, I can take it. Created attachment 236825 [details]
Test program
Attached test program. To use, cd to the file system under test and run. It will call copy_file_range across the RLIMIT_FSIZE boundary and verify that the write gets truncated rather than failing.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=52360ca32ff90b605ac7481fd79e6a251e8b5116 commit 52360ca32ff90b605ac7481fd79e6a251e8b5116 Author: Alan Somers <asomers@FreeBSD.org> AuthorDate: 2022-09-25 22:53:36 +0000 Commit: Alan Somers <asomers@FreeBSD.org> CommitDate: 2022-09-26 21:22:29 +0000 copy_file_range: truncate write if it would exceed RLIMIT_FSIZE PR: 266611 MFC after: 2 weeks Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D36706 sys/fs/fuse/fuse_vnops.c | 15 +++-- sys/fs/nfsclient/nfs_clvnops.c | 8 ++- sys/kern/vfs_vnops.c | 14 ++-- tests/sys/fs/fusefs/copy_file_range.cc | 113 +++++++++++++++++++++++++-------- 4 files changed, 115 insertions(+), 35 deletions(-) Fixed in main. No MFC to stable/12 , because stable/12 lacks copy_file_range. A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=0733dd8a9353a1b9796ffeca0120c5c3642df48b commit 0733dd8a9353a1b9796ffeca0120c5c3642df48b Author: Alan Somers <asomers@FreeBSD.org> AuthorDate: 2022-09-25 22:53:36 +0000 Commit: Alan Somers <asomers@FreeBSD.org> CommitDate: 2022-10-12 04:49:39 +0000 copy_file_range: truncate write if it would exceed RLIMIT_FSIZE PR: 266611 Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D36706 (cherry picked from commit 52360ca32ff90b605ac7481fd79e6a251e8b5116) sys/fs/fuse/fuse_vnops.c | 15 +++-- sys/fs/nfsclient/nfs_clvnops.c | 8 ++- sys/kern/vfs_vnops.c | 14 ++-- tests/sys/fs/fusefs/copy_file_range.cc | 113 +++++++++++++++++++++++++-------- 4 files changed, 115 insertions(+), 35 deletions(-) |