diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2025-08-05 20:31:53 +0200 |
---|---|---|
committer | Bernd Schubert <bernd@bsbernd.com> | 2025-09-13 16:16:06 +0200 |
commit | 2317d8602334093ea0c88efee2e6ac326d42adc7 (patch) | |
tree | e22290de3d73692f9bebec77282ff17a96703e9c /LICENSE | |
parent | 3ff309ea9efa8fc95274d35a96aa5700f0a0d6c1 (diff) | |
download | libfuse-2317d8602334093ea0c88efee2e6ac326d42adc7.tar.gz |
libfuse: fix COPY_FILE_RANGE interface
The FUSE protocol uses struct fuse_write_out to convey the return value of
copy_file_range, which is restricted to uint32_t. But the COPY_FILE_RANGE
interface supports a 64-bit size copies.
Currently the number of bytes copied is silently truncated to 32-bit, which
is unfortunate at best.
Implement the COPY_FILE_RANGE_64 interface which is identical to the old
one, except the number of bytes copied is returned in a 64-bit value.
The library interface remains the same.
If the kernel does not support the new interface or the server is running
as a 32-bit process, limit the copy size to size to UINT_MAX - 4096.
Edit by Bernd:
Keep ioctl_64bit and add use new bit is_copy_file_range_64 to keep
flags separated from each other - easier code readability IMO.
Reported-by: Florian Weimer <fweimer@redhat.com>
Closes: https://lore.kernel.org/all/lhuh5ynl8z5.fsf@oldenburg.str.redhat.com/
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
Diffstat (limited to 'LICENSE')
0 files changed, 0 insertions, 0 deletions