Skip to content
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

Hardlinked files are not counted properly #36

Closed
Freaky opened this issue Feb 22, 2020 · 5 comments
Closed

Hardlinked files are not counted properly #36

Freaky opened this issue Feb 22, 2020 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Freaky
Copy link
Contributor

Freaky commented Feb 22, 2020

The same file can appear in multiple places in a directory hierarchy. This includes things like Rust's own build directories, /rescue partitions with tools like busybox, backups using rsync --link-dest, and so forth.

Traditional du's deal with this by keeping a map of seen inodes and their link counts, and avoid counting additional copies of the same inode - decrementing the link count until all have been seen and the inode can be forgotten. This may not be perfect for an interactive tool like this, but it would probably be better than nothing.

@Byron Byron added enhancement New feature or request help wanted Extra attention is needed labels Feb 22, 2020
@Byron
Copy link
Owner

Byron commented Feb 22, 2020

Thanks a lot for posting your insights on how this is actually implemented in du. This might be helpful when trying to resolve this issue.

Performance-wise it might be OK to implement it, even though the memory consumption might go up visibly. However, being correct AND fast (enough) by default is my preference, too, and as long as hardlink tracking can be disabled I would be happy to see this fixed.

@Freaky
Copy link
Contributor Author

Freaky commented Feb 22, 2020

-% target/debug/dua -l /rescue
   1.14 GB /rescue
-% target/debug/dua /rescue
  14.22 MB /rescue

:)

@Byron
Copy link
Owner

Byron commented Feb 22, 2020

cannot wait :)))!

@Freaky
Copy link
Contributor Author

Freaky commented Feb 22, 2020

Hang on while I beat git into submission and repaint part of the bikeshed :)

@Byron
Copy link
Owner

Byron commented Feb 22, 2020

Closed with release v2.3.0 :)!

@Byron Byron closed this as completed Feb 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants