Skip to content

Fix -delete on FreeBSD NFS mounts #67

@tavianator

Description

@tavianator

Doing unlink() during readdir() on FreeBSD makes it skip some directory entries: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=57696

Easily reproducible with

$ mkdir foo && touch foo/{1..256}
$ bfs foo -delete
bfs: error: foo: Directory not empty.
$ bfs foo -delete
$

However, find, rm, etc. seem to work around it. truss indicates that they fully read the directory before starting to remove files. That means we have some workarounds:

$ mkdir foo && touch foo/{1..256}
$ ./bfs -S dfs foo -delete
$ mkdir foo && touch foo/{1..256}
$ ./bfs -s foo -delete
$

But it would be nice if plain bfs worked too.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions