Bug 135461

Summary: copy_file_range: Please clarify if overlapping ranges in the same file are supported
Product: File System Reporter: Christoph Reiter (reiter.christoph)
Component: VFSAssignee: fs_vfs
Status: NEW ---    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: Linux debian 4.6.0-1-amd64 #1 SMP Debian 4.6.3-1 (2016-07-04) x86_64 GNU/Linux Subsystem:
Regression: No Bisected commit-id:

Description Christoph Reiter 2016-07-17 16:30:23 UTC
I'd like to know if overlapping areas are supported with copy_file_range. From my testing it works with xfs and ext4, but I'd like to have confirmation that this wont break in the future or with other file systems.

Having this in the man page would help a lot.

My use case for copying overlapping areas in the same file is prepending data to a file. I was hoping that copy_file_range would make this faster compared to mmap/memmove in case the file is on a NFS mount.

Thanks
Comment 1 Christoph Reiter 2016-07-18 21:30:20 UTC
OK, after some testing I see that it does not work and not everything gets copied.

Adding this limitation to the man page would help.