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

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Feb 13 23:08:32 UTC 2021


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

--- Comment #11 from Rick Macklem <rmacklem at FreeBSD.org> ---
Ok, so now I see that stripping of d_ino == 0
entries must be done below the VOP_READDIR().
When I did r283330 to get rid of the creation
of d_ino == 0 entries to fill up the block
being filled in the buffer cache, I
did not adjust uio_offset to indicate the
offset of the next block.
--> For my 6K/8K case, I could have advanced
    uio_offset by 8K even though it filled
    6K into the buffer cache block.
    That might have made the caching work?
    I'll give that a try.
    --> It helps that read(2) is no longer
        expected to read directories.

man getdirentries should be fixed for the
d_off == 0 case. I'll come up with a man
page patch and stick it on phabricator,
because filling in d_off needs some thought
for NFS. There may be some cases where the
server's directory offset cookie can be
used.

Ignore trying to revert the change done to UFS in r252438,
since the stripping cannot be done above the VOP_READDIR().
Unless both UFS and ZFS had the property
that removal of an entry in a directory
does not change other directory offsets,
it is not worth worrying about.
--> It also implies that d_ino == 0
    dirents will be passed to user space
    which is not really intended now?
At least that's my opinion.
(And, yes, it was an aside and a separate issue.)

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


More information about the freebsd-fs mailing list