mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
FreeBSD: Lock vnode in zfs_ioctl()
Previously vnode was not locked there, unlike Linux. It required locking it in vn_flush_cached_data(), which recursed on the lock if called from zfs_clone_range(), having the vnode locked. Reviewed-by: Alan Somers <asomers@gmail.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Alexander Motin <mav@FreeBSD.org> Sponsored by: iXsystems, Inc. Closes #16789 Closes #16796
This commit is contained in:
committed by
Brian Behlendorf
parent
ecd0b1528e
commit
90603601b4
@@ -291,8 +291,12 @@ zfs_ioctl(vnode_t *vp, ulong_t com, intptr_t data, int flag, cred_t *cred,
|
||||
case F_SEEK_HOLE:
|
||||
{
|
||||
off = *(offset_t *)data;
|
||||
error = vn_lock(vp, LK_SHARED);
|
||||
if (error)
|
||||
return (error);
|
||||
/* offset parameter is in/out */
|
||||
error = zfs_holey(VTOZ(vp), com, &off);
|
||||
VOP_UNLOCK(vp);
|
||||
if (error)
|
||||
return (error);
|
||||
*(offset_t *)data = off;
|
||||
|
||||
Reference in New Issue
Block a user