Re: NFSv4.2 READ_PLUS support?

From: Rob Norris <robn_at_despairlabs.com>
Date: Mon, 25 Aug 2025 02:29:22 UTC
On Mon, 25 Aug 2025, at 12:08 PM, Rick Macklem wrote:
> > I'd be happy to work on the ZFS side with a partner on the
> > FreeBSD side.
> I will think about what arguments a VOP_READPLUS() might have, but it
> will be a while. (Next year is probably a reasonable timeframe.) And,
> yes, I would definitely need help w.r.t. the ZFS implementation.

No probs, I'm in no hurry. In the meantime, I'll get a bit more familiar
with the NFS specs.

> Fyi, Sec. 15.11.3 of RFC7862 seems to be vague on what the Seek
> operation (and what a hole is). It does state...
>
>    SEEK is an operation that allows a client to determine the location
>    of the next data_content4 in a file.  It allows an implementation
>    of the emerging extension to the lseek(2) function to allow clients
>    to determine the next hole whilst in data or the next data whilst
>    in a hole.
>
> Which seems to indicate that it is meant to be lseek(2)
> compatible and, although it was not a ratified standard when
> RFC7862 was published, I think it is now a ratified POSIX
> standard (or will be soon?).

Yeah, the "emerging extension" here must be SEEK_DATA/SEEK_HOLE, which
hung around as Austin Group Bug 415[1] until the POSIX 2024 update
(compare 2008.2016[2] with 2024[3]).

> ps: I have never seen a statement that SEEK_DATA/SEEK_HOLE  must find
>     all unallocated regions in a sparse file, although I  understand
>     that that would be a nice feature.

I mean, I am very interested in it being the most accurate it can be at
any particular moment, but I can't see how that could ever be required
because it adds a certain amount of semantic meaning that can't be
understood without knowing what the application will use that
information before and what the consequences are of returning incorrect,
stale or changed information (and after #15526[4] I'm quite sensitive to
the dangers of misreporting holes!).

Cheers,
Rob.

1. https://austingroupbugs.net/view.php?id=415
2. https://pubs.opengroup.org/onlinepubs/9699919799.2016edition/functions/lseek.html
3. https://pubs.opengroup.org/onlinepubs/9799919799/functions/lseek.html
4. https://github.com/openzfs/zfs/issues/15526