Bug 429102

Summary: Trash does not show correct size when disk has less free space available than trash size
Product: [Frameworks and Libraries] frameworks-kio Reporter: Claudius Ellsel <claudius.ellsel>
Component: Properties dialogAssignee: KIO Bugs <kio-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal CC: kdelibs-bugs
Priority: NOR    
Version: git master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Free space on root partition
Free space displayed for the trash

Description Claudius Ellsel 2020-11-14 17:35:46 UTC
SUMMARY
This is somewhat related to https://bugs.kde.org/show_bug.cgi?id=426704.

STEPS TO REPRODUCE
1. Use Plasma with default settings
2. Fill the disk until less space is available than the trash size

OBSERVED RESULT
When on the trash page, dolphin shows all trash size as available space in trash.

EXPECTED RESULT
It should consider the already occupied space on the drive that will not be available for the trash.

This behavior might cause unexpected effects when a non default option for treating trash files when the trash is full is selected (like deleting them), although it might be impossible to get a full trash in this state.
Comment 1 Claudius Ellsel 2020-11-14 17:37:47 UTC
Created attachment 133335 [details]
Free space on root partition
Comment 2 Claudius Ellsel 2020-11-14 17:38:06 UTC
Created attachment 133336 [details]
Free space displayed for the trash
Comment 3 Christoph Feck 2020-12-01 12:51:42 UTC
Wait, does moving a file to trash actually copy the file? That itself would be a bug.
Comment 4 Claudius Ellsel 2020-12-01 13:00:36 UTC
Did you comment on the right bug? If yes, I don't understand what you mean with copy and how that is related to this report.
Comment 5 Christoph Feck 2020-12-01 15:55:15 UTC
Moving a file doesn't cause new block allocations, so the available space doesn't change. Copying does cause block allocations, and the size available for the trash would indeed need to take into account the available space for these.
Comment 6 Claudius Ellsel 2020-12-01 16:26:26 UTC
While writing my answer I finally got what you meant. I had the misconception that trashing files would occupy new space which is not true (and also solved for external drives recently). So the space is indeed displayed correctly.

If that is the case then https://bugs.kde.org/show_bug.cgi?id=426704 (where I got the inspiration from for this bug) has been wrongly addressed, correct?
Comment 7 Christoph Feck 2020-12-01 21:20:44 UTC
I am too tired to investigate/read properly, but if I understand this report correctly, it is NOTABUG.

The Trash size is a limit to avoid that all space is occupied by trashed files.
Imagine you have configured your Trash size to 100GB, with 12GB already used there. Disk has only 44GB space left. Now you are able to move an additional 88GB of files to the Trash, without changing the 44GB free space figure.
Comment 8 Christoph Feck 2020-12-01 21:25:30 UTC
Regarding bug 426704, you are probably correct that the fix is wrong.
Comment 9 Claudius Ellsel 2020-12-02 11:05:55 UTC
Agreed, so closing this bug.