Bug 493640 - .Trash directory in mounted drive is not used
Summary: .Trash directory in mounted drive is not used
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Trash (show other bugs)
Version: 6.1.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-25 16:07 UTC by ywywywx
Modified: 2025-04-13 04:10 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ywywywx 2024-09-25 16:07:06 UTC
***
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
When trying to move a large file from a mounted drive to trash using Dolphin, the file is always moved to ~/.local/share/Trash instead of $topdir/.Trash.
This problem can also be reproduced using kioclient:

STEPS TO REPRODUCE
$ mount | grep st8     
    34: st8 on /var/mnt/st8 type zfs (rw,relatime,seclabel,xattr,noacl,casesensitive)

$ cd /var/mnt/st8

$ ls -al .Trash .DS_Store                          
.rw-r--r--@ 14k twofyw 23 Sep 11:23 .DS_Store

.Trash:
drwx-----T@ - twofyw 25 Sep 21:46 1000

$ kioclient -v                    
kioclient 6.1.5

$ kioclient move .DS_Store trash:/

OBSERVED RESULT
$ ls .Trash/1000/files
(empty)

$ ls -al ~/.local/share/Trash/files
.rw-r--r--@ 14k twofyw 23 Sep 11:23 .DS_Store


EXPECTED RESULT
The file should be moved to .Trash/1000/files

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Operating System: Aurora-DX 40
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Kernel Version: 6.10.6-200.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × 11th Gen Intel® Core™ i5-11400 @ 2.60GHz
Memory: 29.5 GiB of RAM
Graphics Processor: Mesa Intel® Graphics

ADDITIONAL INFORMATION
Comment 1 ywywywx 2024-09-25 16:22:36 UTC
The distribution I'm using is Fedora Kiniote, which is a image (rpm-ostree) based system. The original mount point of the mounted drive is under /mnt, which is actually an alias to /var/mnt. I assume this causes kio to have trouble detecting the correct mount point in this complicated setup?

$ ls -al /mnt
lrwxrwxrwx. 4 root root 7 Sep  6 16:29 /mnt -> var/mnt

$ zfs get mountpoint st8                 
NAME  PROPERTY    VALUE       SOURCE
st8   mountpoint  /mnt/st8    local
Comment 2 Akseli Lahtinen 2024-09-26 14:05:09 UTC
This should be fixed with next version of Dolphin, see https://invent.kde.org/system/dolphin/-/merge_requests/828
Comment 3 ywywywx 2024-09-26 15:24:14 UTC
(In reply to Akseli Lahtinen from comment #2)
> This should be fixed with next version of Dolphin, see
> https://invent.kde.org/system/dolphin/-/merge_requests/828

I'm afraid the fix mentioned in the merge request doesn't address the problem I'm experiencing.

I've reviewed the corresponding bug report (https://bugs.kde.org/show_bug.cgi?id=493247), and I noticed that it describes a different issue:

- Bug 493247 describes stale state of trash:/ when $topdir is unmounted after a file is correctly trashed into $topdir/.Trash. In contrast, my problem is that $topdir/.Trash is consistently ignored, with or without device changes after boot.
- Moreover, https://invent.kde.org/system/dolphin/-/merge_requests/828 is specific to Dolphin. However, my problem can be reproduced using kioclient without Dolphin being involved, suggesting that the root cause lies in the kio library instead of Dolphin, which this merge request modifies.