Skip to content

Commit d4c8c8a

Browse files
amotinrkojedzinszky
authored andcommitted
FreeBSD: Reduce copy_file_range() source lock to shared
Linux locks copy_file_range() source as shared. FreeBSD was doing it also, but then was changed to exclusive, partially because KPI of that time was doing so, and partially seems out of caution. Considering zfs_clone_range() uses range locks on both source and destination, neither should require exclusive vnode locks. But one step at a time, just sync it with Linux for now. Reviewed-by: Alan Somers <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Sponsored by: iXsystems, Inc. Closes openzfs#16789 Closes openzfs#16797
1 parent 7d41b36 commit d4c8c8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

module/os/freebsd/zfs/zfs_vnops_os.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6095,7 +6095,7 @@ zfs_freebsd_copy_file_range(struct vop_copy_file_range_args *ap)
60956095
} else {
60966096
#if (__FreeBSD_version >= 1302506 && __FreeBSD_version < 1400000) || \
60976097
__FreeBSD_version >= 1400086
6098-
vn_lock_pair(invp, false, LK_EXCLUSIVE, outvp, false,
6098+
vn_lock_pair(invp, false, LK_SHARED, outvp, false,
60996099
LK_EXCLUSIVE);
61006100
#else
61016101
vn_lock_pair(invp, false, outvp, false);

0 commit comments

Comments
 (0)