mirror of
https://github.com/linux-apfs/linux-apfs-rw.git
synced 2026-08-18 02:19:59 -07:00
Don't let copy_file_range() use clones
I'm seeing a silly regression in generic/430: now that clones are implemented, copy_file_range() has started to use them under the hood, but it only wants to clone a portion of the file, and that's not something I'm interested in supporting. To avoid this on newer kernels, set ->copy_file_range() to the generic implementation. For older kernels, start throwing errors if anything calls apfs_remap_file_range() for partial ranges. This is the right thing to do in general, since we don't support that. Signed-off-by: Ernesto A. Fernández <ernesto@corellium.com>
This commit is contained in:
1 parent
b00b571757
commit
396650b056
2 files changed
+5
No files matched your search
@@ -1504,6 +1504,10 @@ loff_t apfs_remap_file_range(struct file *src_file, loff_t off, struct file *dst
|
||||
if (src_inode == dst_inode)
|
||||
return -EINVAL;
|
||||
|
||||
/* We only want to clone whole files, like in the official driver */
|
||||
if (off != 0 || destoff != 0 || len != 0)
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
* Clones here work in two steps: first the user creates an empty target
|
||||
* file, and then the user calls the ioctl, which replaces the file with
|
||||
|
||||
Reference in new issue
Block a user