Bug 352803 - Dolphin 15.08.1 trash doesn't detect/respect file system boundaries causing slow deletions and excessive disk writes
Summary: Dolphin 15.08.1 trash doesn't detect/respect file system boundaries causing s...
Status: RESOLVED DUPLICATE of bug 76380
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: trash (show other bugs)
Version: unspecified
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-16 15:06 UTC by Stefan Hamminga
Modified: 2018-04-16 20:05 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Bash script to detect whether two paths/files are in the same file system (516 bytes, application/x-shellscript)
2015-09-16 21:31 UTC, Stefan Hamminga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Hamminga 2015-09-16 15:06:45 UTC
My home directory is setup with a number of symlinks and (systemd on-demand) sshfs mounts to allow working with both local and remote storage in an almost seamless fashion. Excellent stuff and i.m.h.o. a big selling point for the Linux desktop.

One issue remaining though is the default delete action in Dolphin. Deleting a file in any other file system than the one trash resides in will result in everything being *copied* to the trash directory, then deleted from the other FS or remote location. Side note: Different BTRFS subvolumes will behave like this too, even when they are on the same FS.

Some intelligence would need to be added to make this more workable. Maybe a canonical path based check to see which trash a set of deleted files belongs in?

Reproducible: Always

Steps to Reproduce:
1. In Dolphin, navigate to a different file system
2. Delete a (huge) file
3. See how the file is moved (copied/deleted) at disk copy speed.

Actual Results:  
Lots of data moving around, increased SSD wear and power consumption.

Expected Results:  
Use a local (w.r.t. the items being deleted) trash or ask the user to permanently delete the file.
Comment 1 Frank Reininghaus 2015-09-16 20:33:12 UTC
Thanks for the bug report. This is not a Dolphin issue - you will see the same behavior if you use another way to move the files to the trash another way, like with Plasma's Folder View widget.

I am not sure if/how it is possible at all to implement what you suggest and find a generic way to find a suitable trash directory for any given path.
Comment 2 Stefan Hamminga 2015-09-16 21:31:32 UTC
Created attachment 94608 [details]
Bash script to detect whether two paths/files are in the same file system
Comment 3 Stefan Hamminga 2015-09-16 21:38:46 UTC
I've put together a small bash script as a proof of concept to show how the heuristics could function.
Qt has a canonical path function which should be similar to the readlink utility I've used, from what I read in the online docs.
The tool also shows the local mount point for the different file system.
Comment 4 Frank Reininghaus 2015-09-16 21:43:03 UTC
I was not claiming that it is not possible to determine if two paths have the same mount point. However, even if you know that a given path does not have the same mount point as the user's home directory, it is not clear what a suitable trash directory would be. That's what I meant with my comment.

But I have only very little knowledge of the Trash implementation, so I will shut up now ;-)
Comment 5 Nate Graham 2018-04-16 20:05:47 UTC

*** This bug has been marked as a duplicate of bug 76380 ***