[PATCH] D44960: [llvm-cov] Prevent llvm-cov from hanging when a symblink doesn't exist.

Sam McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 28 01:00:15 PDT 2018


sammccall added a comment.
Herald added a subscriber: kristina.

Sorry for the late followup here, I just found this patch while investigating some misbehavior.

It appears the `update_error_code_for_current_entry` prevents iterating over a directory without `stat()`ing every file in it.
This is bad for performance in the common case where only the name/type is required.
(There were other things in fs/vfs causing every file to be stat()ed, they are now fixed).

Moreover, the idea that a dangling symlink is an error for a *directory listing* operation is surprising, and seems like solving problems at the wrong layer.
(e.g. `recursive_directory_iterator` needs to know if an entry is a dangling symlink, but it should find out using `opendir()` rather than with `stat()`)

If there are no objections, I'd like to remove this behavior of directory_iterator so we can have fast directory iteration, and find a different fix for recursive_directory_iterator.


Repository:
  rL LLVM

https://reviews.llvm.org/D44960





More information about the llvm-commits mailing list