After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 766030 - Deleting files immediately might not work when disk is full
Deleting files immediately might not work when disk is full
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Trash
unspecified
Other Linux
: Normal normal
: 3.20
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-05-05 15:11 UTC by Mario Sánchez Prada
Modified: 2016-05-09 20:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch proposal (2.47 KB, patch)
2016-05-05 15:29 UTC, Mario Sánchez Prada
committed Details | Review

Description Mario Sánchez Prada 2016-05-05 15:11:48 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.
Comment 1 Mario Sánchez Prada 2016-05-05 15:29:47 UTC
Created attachment 327352 [details] [review]
Patch proposal

Attaching a patch that fixes the issue, locally tested.

Please review, thanks!
Comment 2 Carlos Soriano 2016-05-06 08:18:10 UTC
Review of attachment 327352 [details] [review]:

ugh big oversight. Thanks for the patch, Mario!
Comment 3 Michael Catanzaro 2016-05-09 20:02:24 UTC
(Forgot to close this!)