Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Dec 2021 03:37:48 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 260375] NFS server truncates directory cookies to 32-bits
Message-ID:  <bug-260375-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D260375

            Bug ID: 260375
           Summary: NFS server truncates directory cookies to 32-bits
           Product: Base System
           Version: 13.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: asomers@FreeBSD.org

VOP_READDIR can return a list of cookies that store seek offsets for the
directory entries returned in uio.  Each cookie is a 64-bit value, matching=
 the
64-bit d_off field in struct dirent.  However, The NFS server truncates the=
se
cookies to 32-bits.  It happens in both nfsrvd_readdir and nfsrvd_readdirpl=
us.=20
The relevant lines are these:

*tl++ =3D 0;
*tl =3D txdr_unsigned(*cookiep);

That works just fine for UFS, where dirent offsets correspond to byte offse=
ts
within a densely packed array.  And it works just fine for ZFS, where dirent
offsets seem to come from a 29-bit hash function.  But it fails for the FUSE
file system I'm developing, where the dirent offset uses all 64 bits.

According to RFC-1813, the NFSv3 standard, the cookie3 data type is a uint64
variable.  I can't figure out any good reason why the NFS server should
truncate it.  It's probably just a legacy thing.  I'll try to come up with a
patch.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



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