aboutsummaryrefslogtreecommitdiffstats
path: root/module/os/freebsd/zfs/zfs_vnops_os.c
diff options
context:
space:
mode:
authororomenahar <[email protected]>2023-08-08 18:37:06 +0200
committerGitHub <[email protected]>2023-08-08 09:37:06 -0700
commit019dea0a558517bf327d2c52e84a3a4b01eaaeb8 (patch)
tree1e31c5789d0cce81af57fc9dce9e17edbac9a0f3 /module/os/freebsd/zfs/zfs_vnops_os.c
parent683edb32b73885d1718a2220fe08c4cd61e63fd1 (diff)
zfs_clone_range should return a descriptive error codes
Return the more descriptive error codes instead of `EXDEV` when the parameters don't match the requirements of the clone function. Updated the comments in `brt.c` accordingly. The first three errors are just invalid parameters, which zfs can not handle. The fourth error indicates that the block which should be cloned is created and cloned or modified in the same transaction group (`txg`). Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Rob Norris <[email protected]> Signed-off-by: Kay Pedersen <[email protected]> Closes #15148
Diffstat (limited to 'module/os/freebsd/zfs/zfs_vnops_os.c')
-rw-r--r--module/os/freebsd/zfs/zfs_vnops_os.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/module/os/freebsd/zfs/zfs_vnops_os.c b/module/os/freebsd/zfs/zfs_vnops_os.c
index e80e29c2d..0ffed347f 100644
--- a/module/os/freebsd/zfs/zfs_vnops_os.c
+++ b/module/os/freebsd/zfs/zfs_vnops_os.c
@@ -6288,7 +6288,7 @@ zfs_freebsd_copy_file_range(struct vop_copy_file_range_args *ap)
error = zfs_clone_range(VTOZ(invp), ap->a_inoffp, VTOZ(outvp),
ap->a_outoffp, &len, ap->a_outcred);
- if (error == EXDEV || error == EOPNOTSUPP)
+ if (error == EXDEV || error == EINVAL || error == EOPNOTSUPP)
goto bad_locked_fallback;
*ap->a_lenp = (size_t)len;
out_locked: