[Bug 197336] find command cannot see more than 32765 subdirectories when using ZFS

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Feb 18 20:48:05 UTC 2015


Jilles Tjoelker <jilles at FreeBSD.org> changed:

           What    |Removed                     |Added
                 CC|                            |jilles at FreeBSD.org

--- Comment #4 from Jilles Tjoelker <jilles at FreeBSD.org> ---
Although bde@ is right that FreeBSD cannot report the link count correctly if a
directory has more than 32765 subdirectories, this usually need not be a
problem. The fts(3) code underlying find(1) uses the link count to avoid stat
calls, even on filesystems (most) that support d_type which allows avoiding the
same stat calls.

Some possible solutions are disabling the nlink optimization if fts_nlink >=
LINK_MAX, disabling the nlink optimization for ZFS, ignoring the nlink
optimization if d_type tells otherwise and removing the nlink optimization

As a workaround, specify a find(1) expression that forces it to stat
everything, such as -ls or -size 0 -o -size +0.

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

More information about the freebsd-bugs mailing list