HomeFreeBSD

nfs: don't truncate directory cookies to 32-bits in the NFS server

Description

nfs: don't truncate directory cookies to 32-bits in the NFS server

In NFSv2, the directory cookie was 32-bits. NFSv3 widened it to
64-bits and SVN r22521 widened the corresponding argument in
VOP_READDIR, but FreeBSD's NFS server continued to treat the cookies as
32-bits, and 0-extended to fill the field on the wire. Nobody ever
noticed, because every in-tree file system generates cookies that fit
comfortably within 32-bits.

Also, have better type safety for txdr_hyper. Turn it into an inline
function that type-checks its arguments. Prevents warnings about
shift-count-overflow.

PR: 260375
Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D33404

(cherry picked from commit 32fbc5d824f51f97220bc5c61a23e0bf3ff2b470)

Details

Provenance
asomersAuthored on Dec 13 2021, 3:57 AM
Reviewer
rmacklem
Differential Revision
D33404: nfs: don't truncate directory cookies to 32-bits in the NFS server
Parents
rGf09df4b05cf4: fusefs: correctly handle an inode that changes file types
Branches
Unknown
Tags
Unknown