Skip to content

Commit

Permalink
FreeBSD: stop passing LK_INTERLOCK to VOP_LOCK
Browse files Browse the repository at this point in the history
There is an ongoing effort to eliminate this feature.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes #13908
  • Loading branch information
mjguzik authored and tonyhutter committed Sep 28, 2022
1 parent 55816c6 commit 2c8e3e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion module/os/freebsd/zfs/zfs_ctldir.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,12 +976,13 @@ zfsctl_snapdir_lookup(struct vop_lookup_args *ap)
*/
VI_LOCK(*vpp);
if (((*vpp)->v_iflag & VI_MOUNT) == 0) {
VI_UNLOCK(*vpp);
/*
* Upgrade to exclusive lock in order to:
* - avoid race conditions
* - satisfy the contract of mount_snapshot()
*/
err = VOP_LOCK(*vpp, LK_TRYUPGRADE | LK_INTERLOCK);
err = VOP_LOCK(*vpp, LK_TRYUPGRADE);
if (err == 0)
break;
} else {
Expand Down

0 comments on commit 2c8e3e4

Please sign in to comment.