-
-
Notifications
You must be signed in to change notification settings - Fork 798
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix infinite loop when the fs fails. Closes #1164
- Loading branch information
Showing
1 changed file
with
16 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eb8ffc6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deluan This will break the "find all subdirs when some are missing rx permissions" behavior fixed by #1054
The loop over ReadDir was not a bug.
https://pkg.go.dev/os#File.ReadDir
#1164 reports a scenario where mounts appear to be broken; the golang behavior here doesn't seem right (it should "succeed" and not remain stuck on the same directoryentry), but the fix is not to bail on the first error - there may be more entries available with a properly functioning filesystem.
The guts of this bug appear in this case limited to the unix os, so it looks like, again just for this case, it might also work to return when
the error is a
PathError
and theOp
is "readdirent"An alternative hack/workaround/sanity-check would be to look for identical, successive errors (full error string, including the failing path), and bail, assuming that to have been an impossible occurance