Re: Fixing VOP_READDIR for 64-bit directory cookies

From: Alexander Motin <mav_at_FreeBSD.org>
Date: Tue, 14 Dec 2021 02:59:17 UTC
On 13.12.2021 21:47, Alan Somers wrote:
> tldr; this change allows the NFS server to export file systems that
> use 64-bit directory cookies
> https://reviews.freebsd.org/D33404
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260375
> 
> Long story:
> NFSv2 included a 32-bit directory cookie with each readdir entry.
> NFSv3 widened it to 64-bits, and FreeBSD's SVN r22521 raised
> VOP_READDIR's cookies argument to a u_long.  That's 64-bits on some
> architectures, but 32-bits on others.  But since the NFS server is the
> only caller that uses cookies, VOP_READDIR really ought to use a
> 64-bit type on all architectures.  For NVSv2-exported file systems,
> the NFS server will ignore the top 32-bits of the cookie.
> 
> There are no in-tree file systems that use more than 32 bits for their
> directory cookies, but it matters for some FUSE file systems.
> 
> Does anybody have any opinions about this change, or about whether/how
> to MFC it?

Since changing the VOP_READDIR argument type will probably break
external file system modules I'd say it is not acceptable for MFC.  But
merge of the NFS part only should fix the issue for the 64-bit machines,
which should be good enough for the most people.

-- 
Alexander Motin