SUMMARY Filelight does wrongly calculate the size of the /var/lib/flatpak/ directory. This directory contains many hard links. Because of this Filelight includes files multiple times into the size calculation. One gets the correct size of the directory with this bash argument: du -sh /var/lib/flatpak/ STEPS TO REPRODUCE 1. Open Filelight 2. Let Filelight calculate the size of /var/ OBSERVED RESULT The directory size that Filelight gives for /var/lib/flatpak/ is twice as large as the size that du returns. EXPECTED RESULT The directory size that Filelight gives for /var/lib/flatpak/ is the same as that which du returns. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Fedora 41 KDE Plasma Version: 6.3.1 KDE Frameworks Version: 6.11.0 Qt Version: 6.8.2 ADDITIONAL INFORMATION
The code that is meant to deduplicate hardlinks is not correctly implemented. Currently it resides on the PosixWalker as a std::set, skipping nodes that are already in the set. The walkers are run in any number of threads though, so that set is never complete. Needs some thinking about where to best track this. A global cache across all walkers would work, but needs mutexing so maybe passing the dev-inode out of the walker is more efficient (we have a global accumulation lock anyway) but then we kinda break abstraction a bit.