Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Aug 2022 22:17:36 +0000
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        FreeBSD Filesystems <freebsd-fs@freebsd.org>
Subject:   SEEK_DATA/SEEK_HOLE with vnode locked
Message-ID:  <YQBPR0101MB97420AD41791E544519A0A2DDD659@YQBPR0101MB9742.CANPRD01.PROD.OUTLOOK.COM>

next in thread | raw e-mail | index | archive | help
Hi,=0A=
=0A=
When implementing what is called Read_Plus for the NFSv4.2=0A=
server, I need to do SEEK_DATA/SEEK_HOLE. However, if I=0A=
use VOP_IOCTL(), I need to unlock/relock the vnode.=0A=
=0A=
This can result in problems if another RPC changes the size=0A=
of the file or allocates/deallocates data in the file while the=0A=
vnode is unlocked.=0A=
=0A=
>From what I can see, UFS does SEEK_DATA/SEEK_HOLE with=0A=
the vnode locked and ZFS doesn't seem to care/notice if it=0A=
is locked.=0A=
(Actually, ZFS looks like it might be unsafe, since it seems to=0A=
 assume it can use the unlocked vnode that might be doomed,=0A=
 but I do not know ZFS.)=0A=
=0A=
Anyhow, does implementing a new vnode op VOP_SEEK(), which=0A=
takes a locked vnode and does SEEK_DATA/SEEK_HOLE sound=0A=
reasonable?=0A=
=0A=
Thanks in advance for any info, rick=0A=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YQBPR0101MB97420AD41791E544519A0A2DDD659>