[Bug 233436] rm -rf fails when the number of subfolders of a folder in a tree is too high

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Dec 4 23:02:38 UTC 2018


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

Jilles Tjoelker <jilles at FreeBSD.org> changed:

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

--- Comment #3 from Jilles Tjoelker <jilles at FreeBSD.org> ---
This is probably another instance of bug #197336, except that instead of
find(1), rm(1) is affected.

The bug is in the common fts(3) code, which assumes that there are no more
subdirectories than the st_nlink field reports (minus two for . and ..). This
assumption is incorrect with ZFS, since it supports more subdirectories than
fit in the st_nlink field's data type (nlink_t). As a result, fts(3) reports to
rm(1) that the subdirectories are not directories, and rm(1) tries to unlink(2)
them, which fails with [EPERM].

In 12.0, nlink_t has been enlarged so it can report the correct number of
subdirectories with ZFS, so this bug should no longer occur on that version.
The fts(3) code in 11.x could be fixed in various ways as discussed in bug
#197336.

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


More information about the freebsd-bugs mailing list