Bug 497011 - Dolphin incorrectly calculates the total size of the files under / (the filesystem root directory)
Summary: Dolphin incorrectly calculates the total size of the files under / (the files...
Status: CONFIRMED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 24.05.1
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-03 20:46 UTC by kde.curly785
Modified: 2025-01-17 08:50 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
A screenshot of dolphin incorrectly reporting the size of files in the root folder. (85.26 KB, image/png)
2024-12-03 20:46 UTC, kde.curly785
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kde.curly785 2024-12-03 20:46:46 UTC
Created attachment 176331 [details]
A screenshot of dolphin incorrectly reporting the size of files in the root folder.

***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

SUMMARY
In Dolphin v24.05.1 (latest supplied by the arch repository), when calculating the size of a folder it will incorrectly read the number of bytes as kilobytes, and report a much much larger used size than reality.

STEPS TO REPRODUCE
1. Right click root folder and go to properties
2. Calculate "size"

OBSERVED RESULT
Size is multiplied by 1024, creating an incorrectly large number

EXPECTED RESULT
Size is reported correctly

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: EndeavourOS, kernel 6.9.7-arch1-1 (64-bit)
KDE Plasma Version: 6.1.1
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION
This does not seem to happen in folders other than "/"
Comment 1 John Kizer 2024-12-15 07:38:01 UTC
I can reproduce a version of this on my system - the size calculated for / is many times higher than the actual space taken, although it's not 1,024 times higher - in fact, it's close to the size reported in your screenshot (mine was 129.4 TiB), despite my mounted filesystems having a total of 1.6 TiB of space used.

Keep in mind the free space chart at the bottom of that window is only going to be for the filesystem on which / is mounted, while if you have multiple filesystems mounted, there will be more files and more size occupied by the total contents of files under / - for example, I have /mnt/usbdrivename, which is its own filesystem, but files on it would presumably be totaled up if everything under / were being added. Perhaps it's more confusing than anything to even allow calculating a total size for / ?

(By the way, if this issue was experienced in December 2024, you may need to check your Arch repository setup - 24.08.3 was the latest Dolphin version in the Arch repositories as of the time this bug was filed, and your system info indicates your kernel/Plasma/other packages are significantly outdated as well)
Comment 2 kde.curly785 2024-12-15 22:25:46 UTC
(In reply to John Kizer from comment #1)
> I can reproduce a version of this on my system - the size calculated for /
> is many times higher than the actual space taken, although it's not 1,024
> times higher - in fact, it's close to the size reported in your screenshot
> (mine was 129.4 TiB), despite my mounted filesystems having a total of 1.6
> TiB of space used.
> 
> Keep in mind the free space chart at the bottom of that window is only going
> to be for the filesystem on which / is mounted, while if you have multiple
> filesystems mounted, there will be more files and more size occupied by the
> total contents of files under / - for example, I have /mnt/usbdrivename,
> which is its own filesystem, but files on it would presumably be totaled up
> if everything under / were being added. Perhaps it's more confusing than
> anything to even allow calculating a total size for / ?
> 
> (By the way, if this issue was experienced in December 2024, you may need to
> check your Arch repository setup - 24.08.3 was the latest Dolphin version in
> the Arch repositories as of the time this bug was filed, and your system
> info indicates your kernel/Plasma/other packages are significantly outdated
> as well)

I did notice that the dolphin version was behind the latest on the github, but at the time it was the latest in the available repositories for endeavourOS
Comment 3 Don Curtis 2025-01-10 17:26:16 UTC
Same on this KDE Plasma 5 system:

Operating System: openSUSE Leap 15.6
KDE Plasma Version: 5.27.11
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.12
Kernel Version: 6.4.0-150600.23.30-default (64-bit)

Dolphin Version 23.08.5

---

When Dolphin calculates the usage of the system root partition device - the device partition mounted as “/” - it calculates everything to be found below the root directory instead of, only those files and directories in the device partition mounted as “/”.

The “Free Space” indicator correctly shows the size and usage of the device partition mounted as “/”.
Comment 4 Méven Car 2025-01-17 08:50:59 UTC
This size computing is done in KIO by FileSystemFreeSpaceJob and implemented by DirectorySizeJob that is meant to compute directory size but not root filesystem.
It would either need to be special cased as in particular /proc should be skipped.
Or Not used when 'file:///' is being requested.