[Bug 253428] getdirentries does not work correctly on NFS mounts

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Feb 13 16:10:57 UTC 2021


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253428

--- Comment #8 from Rick Macklem <rmacklem at FreeBSD.org> ---
r283330, reverted by r291117
I believe the caching story was roughly
(assuming an 8K block size).
- NFS VOP_READDIR() would read the first
  block at logical offset 0
  and then a read-ahead at logical offset 8K.
--> If the readdir reply only filled 6K,
    it would set the b_bcount to 6K

When getdents() or read() did the next read,
it would ask for a block at 6K and the read-ahead
block in the cache would be missed.

Now if someone (I'll not volunteering right
now) were to add code above the VOP_READDIR()
in getdirentries()/getdents() that skipped
over the dirents with d_fileno == 0 but still
advanced f_offset past them, then I think
that would be ok (no change in NFS behaviour).

Also, you could get rid of the similar code
in ufs_readdir(), which would be nice for
the NFS server, since the behaviour of ufs_readdir()
would return to "subsequent directory offsets
do not change when entrie(s) are deleted.
--> With this property, doing readdir(), unlink()
    in a loop works over NFS.

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


More information about the freebsd-fs mailing list