ignore: partially revert symlink loop check optimization

This optimization wasn't tested too carefully, and it seems to result
in a massive amount of file handles open simultaneously. This is likely
a result of the parallel iterator, where many directories are being
traversed simultaneously.

Fixes #648
This commit is contained in:
Andrew Gallant
2017-10-22 10:26:50 -04:00
parent 311ccb1f6b
commit 5714dbde09
2 changed files with 4 additions and 23 deletions

View File

@@ -1312,7 +1312,10 @@ fn check_symlink_loop(
Error::from(err).with_path(child_path).with_depth(child_depth)
})?;
for ig in ig_parent.parents().take_while(|ig| !ig.is_absolute_parent()) {
if ig.handle().map_or(true, |parent| parent == &hchild) {
let h = Handle::from_path(ig.path()).map_err(|err| {
Error::from(err).with_path(child_path).with_depth(child_depth)
})?;
if hchild == h {
return Err(Error::Loop {
ancestor: ig.path().to_path_buf(),
child: child_path.to_path_buf(),