GNOME Bugzilla – Bug 766030
Deleting files immediately might not work when disk is full
Last modified: 2016-05-09 20:02:33 UTC
When trying to send a file to the Trash while the disk is full, sometimes the call to g_file_trash() in nautilus-file-operations.c:trash_file() fails, resulting in a dialog showing up to let the user decide whether to cancel the operation or to delete it inmediately, without moving it to the Trash. In this scenario, clicking on the dialog's "Delete" button to confirm the operation results in nothing happening, and the file remains there until the user removes it via other ways (e.g. Shift + Delete, command line...). This is particularly problematic for non-technical users that can't use their computers properly when the disk is full, because they are left without an easy way to free up some space. An easy way to reproduce this is to fill all the available space with fallocate and dd and then delete the Trash directory so that g_file_trash() will fail when trying to remove the file from nautilus, since it can't create the Trash. STEPS TO REPRODUCE: 1. Remove the local Trash directory: rm -rf ~/.local/share/Trash 2. Fillup all the available space quickly, as root (so that even the FS reserved blocks are filled): sudo fallocate -l 500G ~/filler.fallocate 3. Ensure that there is no space left: sudo dd if=/dev/zero of=~/filler.dd 4. Commit changes to disk: sudo sync 5. Open nautilus, select one file, right click on it and select "Move to Trash" 6. When the dialog opens, confirm that you want to delete it immediately EXPECTED OUTCOME: The selected file is finally deleted without moving it to Trash despite of having the disk full, and the space that the file took up is made available. ACTUAL OUTOME: After clicking on the "Delete" button from step 6 nothing happens: the file remains there and the disk keeps being full.
Created attachment 327352 [details] [review] Patch proposal Attaching a patch that fixes the issue, locally tested. Please review, thanks!
Review of attachment 327352 [details] [review]: ugh big oversight. Thanks for the patch, Mario!
(Forgot to close this!)