mirror_zfs/module/os/linux/zfs
Rob N ead3eea3e0
linux/copy_file_range: properly request a fallback copy on Linux <5.3
Before Linux 5.3, the filesystem's copy_file_range handler had to signal
back to the kernel that we can't fulfill the request and it should
fallback to a content copy. This is done by returning -EOPNOTSUPP.

This commit converts the EXDEV return from zfs_clone_range to
EOPNOTSUPP, to force the kernel to fallback for all the valid reasons it
might be unable to clone. Without it the copy_file_range() syscall will
return EXDEV to userspace, breaking its semantics.

Add test for copy_file_range fallbacks.  copy_file_range should always
fallback to a content copy whenever ZFS can't service the request with
cloning.

Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Kay Pedersen <mail@mkwg.de>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #15131
2023-08-01 11:31:11 -07:00
..
abd_os.c Add assertion and make variables unsigned in abd_alloc_chunks() 2023-02-06 11:10:50 -08:00
arc_os.c Linux 6.4 compat: reclaimed_slab renamed to reclaimed 2023-05-24 12:23:42 -07:00
mmp_os.c Cleanup: 64-bit kernel module parameters should use fixed width types 2022-10-13 10:03:29 -07:00
policy.c Linux 6.3 compat: idmapped mount API changes 2023-04-10 14:15:36 -07:00
qat_compress.c QAT: Fix uninitialized seed in QAT compression 2023-03-16 11:54:10 -07:00
qat_crypt.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
qat.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
spa_misc_os.c Cleanup: 64-bit kernel module parameters should use fixed width types 2022-10-13 10:03:29 -07:00
trace.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
vdev_disk.c Linux 6.5 compat: blkdev changes 2023-08-01 08:37:20 -07:00
vdev_file.c Cleanup: 64-bit kernel module parameters should use fixed width types 2022-10-13 10:03:29 -07:00
zfs_acl.c Use list_remove_head() where possible. 2023-06-09 10:12:52 -07:00
zfs_ctldir.c linux: zfs: ctldir: set [amc]time to snapshot's creation property 2023-08-01 08:50:17 -07:00
zfs_debug.c Cleanup: Replace oldstyle struct hack with C99 flexible array members 2023-01-12 16:00:03 -08:00
zfs_dir.c Linux 6.3 compat: idmapped mount API changes 2023-04-10 14:15:36 -07:00
zfs_file_os.c Cleanup: Remove branches that always evaluate the same way 2022-11-03 10:47:48 -07:00
zfs_ioctl_os.c Linux 6.3 compat: idmapped mount API changes 2023-04-10 14:15:36 -07:00
zfs_racct.c module: zfs: fix unused, remove argsused 2021-12-23 09:42:47 -08:00
zfs_sysfs.c Introduce kmem_scnprintf() 2022-10-29 13:05:11 -07:00
zfs_uio.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zfs_vfsops.c linux: implement filesystem-side copy/clone functions for EL7 2023-07-24 16:37:04 -07:00
zfs_vnops_os.c Linux 6.5 compat: blkdev changes 2023-08-01 08:37:20 -07:00
zfs_znode.c linux: implement filesystem-side copy/clone functions for EL7 2023-07-24 16:37:04 -07:00
zio_crypt.c Linux: Silence static analyzer warning in crypto_create_ctx_template() 2023-03-08 13:51:59 -08:00
zpl_ctldir.c Linux 6.5 compat: blkdev changes 2023-08-01 08:37:20 -07:00
zpl_export.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zpl_file_range.c linux/copy_file_range: properly request a fallback copy on Linux <5.3 2023-08-01 11:31:11 -07:00
zpl_file.c Linux 4.20 compat: wrapper function for iov_iter type access 2023-08-01 08:42:33 -07:00
zpl_inode.c Linux 6.3 compat: idmapped mount API changes 2023-04-10 14:15:36 -07:00
zpl_super.c Fix zpl_test_super race with zfs_umount 2023-07-20 10:30:21 -07:00
zpl_xattr.c Linux 6.3 compat: idmapped mount API changes 2023-04-10 14:15:36 -07:00
zvol_os.c Linux 6.5 compat: blkdev changes 2023-08-01 08:37:20 -07:00