-
Notifications
You must be signed in to change notification settings - Fork 577
In certain conditions in a podman container the link count in a directory may be inaccurate, confusing File::Find #18314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Further note, since I can't replicate this outside of the one host, I can only raise this as a concern, so that if you do see other bug reports there's some added history. Unless File::Find does a run-time test to see if directory link counts are accurate indications of the number of directories, I don't see much that can be done. |
|
Yeah, it was an optimization that kept biting us in the tail |
The incorrect directory link count was caused by a mis-configured system. Anyway, glad to hear that had I upgraded to 5.30 I wouldn't have had this problem (but then I wouldn't have fixed the underlying problem). |
If I understand the comments in this ticket correctly, the original problem is not a problem in supported versions of Perl. Hence, this ticket should be closable. Comments? Thank you very much. |
No one has indicated this is not closable and no one has commented further. Closing ticket. Thank you very much. |
You don't need to upgrade to perl 5.30 -- all you need to do is |
Module: File::Find
Description
tldr;
File::Find
to believe either that there are no subdirectories (if nlinks==2) or that there are fewer subdirectories present, producing incorrect results.Caveats
Steps to Reproduce
As mentioned above, I've found it hard to duplicate, but here's my setup. The Dockerfile:
At the command line:
The link count is 3.
`
Note that
File::Find
descends into the apt directory. Now, modify the directoryThe link count has decreased from 3 to 2.
and
File::Find
no longer descends into aptAnalysis
File::Find
may use the link count of a directory to determine the number of subdirectories. This is controlled by the $File::Find::dont_use_nlink variable, which depends upon a configuration variable:(From
File::Find
version 1.34). On Debian 10,Later, in
_find_dir
, the link count to the directory is used to determine if there are any subdirectories, as well as the number of subdirectories. As Perl is configured to trust the link count, the revised link count of 2 after adding the file to the directory convincesFile::Find
that there are no subdirectories, when in fact there are.Expected behavior
I expect File::Find to traverse all of the subdirectories
Perl configuration
The text was updated successfully, but these errors were encountered: