You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This adds a fallback to various fs methods that handles ENAMETOOLONG
by splitting the path into relative segments and then opening each
segment with openat(dirfd, segment, O_PATH).
Limitations:
* not all fs methods are covered. the primary motivation is to get
remove_dir_all working to delete a deep directory structure
created by accident
* requires O_PATH, so this can currently only be a fallback and
not the default due to our current minimum kernel version. If you're
not dealing with long paths it won't be used.
* currently linux-only. this could be extended to platforms which have
either O_PATH or O_EXEC but there's no CI coverage for the BSDs
so I don't want to foist it on them
* O(n²) performance if remove_dir_all has to use the fallback, albeit
a small constant factor due to the long path segments used
but ideally it should be rewritten to use openat in its recursion steps.
But to do it properly we need a higher minimum kernel version.
0 commit comments