! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
On btrfs trash functionality does not work outside of home directory
Status:
RESOLVED: LATER

Comments

Description jw.hendy 2019-09-03 15:14:21 CEST
Trash works fine in ~, but not in other directories like /mnt/foo.

I created a post on the Arch forums, but haven't gotten much for a suggestion. I'm copy/pasting the attempts to debug from there.
- post: https://bbs.archlinux.org/viewtopic.php?id=248120

$ thunar --version
Thunar 1.8.9 (Xfce 4.14)

# fdisk -l
Device           Start       End   Sectors   Size Type
/dev/nvme1n1p1    2048   1050623   1048576   512M EFI System           /boot/efi)
/dev/nvme1n1p2 1050624   3147775   2097152     1G Linux filesystem     /boot)
/dev/nvme1n1p3 3147776 488397134 485249359 231.4G Linux filesystem     cryptsetup root, formatted btrfs

$ mount
/dev/mapper/luks-dc2c470e-ec77-43df-bbe8-110c678785c2 on / type btrfs (rw,relatime,compress=lzo,ssd,discard,space_cache,subvolid=266,subvol=/arch)
/dev/mapper/luks-dc2c470e-ec77-43df-bbe8-110c678785c2 on /mnt/vault type btrfs (rw,relatime,compress=lzo,ssd,discard,space_cache,subvolid=268,subvol=/vault)

$ ls -l /mnt
drwxr-xr-x 1 jwhendy jwhendy 114 Jul 31 14:02 vault

$ ls -la /mnt/vault
drwxrwxrwt 1 jwhendy jwhendy   34 Jul 31 13:52 .Trash-1000

$ id
uid=1000(jwhendy) gid=1000(jwhendy) groups=1000(jwhendy),54(lock),973(realtime),987(uucp),991(lp),993(input),995(audio),998(wheel)

$ pacman -Ss gvfs
extra/gvfs 1.40.2-1 (gnome) [installed]
    Virtual filesystem implementation for GIO

$ ls -l /mnt/vault/.Trash-1000/
total 0
drwx------ 1 jwhendy jwhendy 0 Jul 31 13:52 expunged
drwx------ 1 jwhendy jwhendy 0 Jul 31 13:52 files
drwx------ 1 jwhendy jwhendy 0 Jul 31 13:52 info

Trash works from anything inside ~/, but does not work on /mnt/vault. I'd like to fix this.

What else can I check to understand trash is not working outside my home directory?
Comment 1 alexxcons editbugs 2019-09-03 22:09:21 CEST
For me trash work fine on nfs mount ... possibly related to btrfs.


> What else can I check to understand trash is not working outside my home directory?

Thunar and Nautilus both use gfvs to trash files ... does it work with Nautilus ? (Though the "do you realy want to delete" message sound like it is a thunar problem )

Any Error-Message for  "gio trash <Filename>" ?

You installed “gvfs-backends” and “gvfs-fuse” ?
Comment 2 jw.hendy 2019-09-03 23:03:15 CEST
I wondered about btrfs as well. There was another arch post discussing this possibility:
- https://bbs.archlinux.org/viewtopic.php?id=241785

Re. other behavior:
- Thunar and Nautilus (just tested) have the same behavior: popup "Do you really want to delete"
- pcmanfm asks if I want to delete or trash, and when I say trash it says "Some files cannot be moved to trash can because the underlying file systems don't support this operation. Do you want to delete them instead?"
- dolphin trashes a file from /mnt/vault to ~/.local/share/Trash/files

$ gio trash /mnt/vault/foo.txt
gio: file:///mnt/vault/foo.txt: Trashing on system internal mounts is not supported

Googling the gio error triggered another set of breadcrumbs:
- above links to this arch bug: https://bugs.archlinux.org/task/60137
- and this gnome commit: https://gitlab.gnome.org/GNOME/glib/commit/d1eaf72c001279aa15a2135a0749ef864c8edb42

I'm not exactly sure why this happens, though. Both /mnt/vault and /home/jwhendy are subvols of the same btrfs volume.

Ahhh, now I see. Here's the function, g_unix_is_mount_path_system_internal(), they call to see if it's "system internal":
- https://gitlab.gnome.org/GNOME/glib/blob/master/gio/gunixmounts.c#L223

And that contains a hard-coded list of mount points, which is described to:
"""
* Determines if @mount_path is considered an implementation of the
 * OS. This is primarily used for hiding mountable and mounted volumes
 * that only are used in the OS and has little to no relevance to the
 * casual user.
"""

I guess /mnt and /media are both "of little to no relevance," but I thought these were pretty standard mount points.

That said, I just unmounted /mnt/vault and remounted the subvol to ~/vault (after deleting symlink) and I get the same error. I don't know what differentiates ~ and vault with respect to how glib is checking.

$ mount
/dev/mapper/luks-dc2c470e-ec77-43df-bbe8-110c678785c2 on /home/jwhendy type btrfs (rw,relatime,compress=lzo,ssd,discard,space_cache,subvolid=267,subvol=/jwhendy)

/dev/mapper/luks-dc2c470e-ec77-43df-bbe8-110c678785c2 on /home/jwhendy/vault type btrfs (rw,relatime,compress=lzo,ssd,discard,space_cache,subvolid=268,subvol=/vault)

Everything is the same except the subvol?
Comment 3 alexxcons editbugs 2019-09-04 23:39:57 CEST
That hard coded path collection looks like an ugly hack to me ;)
Though I dont full understand its purpose. I as well mount my stuff on /mnt, but dont get the bug triggered. (But ok, possibly just my gio is too old)


Sorry, I am a bit lost now. Soo this seems to be a gio or gvfs bug ? ( Since it works well within dolphin and does not in Thunar / Nautilus / pcmanfm )

So I would open a new bug there: https://gitlab.gnome.org/GNOME/gvfs or https://gitlab.gnome.org/GNOME/glib
Comment 4 jw.hendy 2019-09-06 15:47:27 CEST
@alexxcons: sorry for the delay. I think your suggestion of gio was key and that the other tidbits around the web definitely point to glib.

I created a bug upstream a couple days ago, just took me a bit to circle back. I would close this as a derivative bug from your inheritance of glib and see what they suggest.

https://gitlab.gnome.org/GNOME/glib/issues/1885

Thanks for the pointers, which led to finding what I think is the actual issue!
Comment 5 jw.hendy 2019-09-06 15:47:54 CEST
I don't see how to close or vote to close... could you handle that?
Comment 6 alexxcons editbugs 2019-09-06 23:45:06 CEST
(In reply to jw.hendy from comment #4)
> @alexxcons: sorry for the delay. I think your suggestion of gio was key and
> that the other tidbits around the web definitely point to glib.
> 
> I created a bug upstream a couple days ago, just took me a bit to circle
> back. I would close this as a derivative bug from your inheritance of glib
> and see what they suggest.
> 
> https://gitlab.gnome.org/GNOME/glib/issues/1885
> 
> Thanks for the pointers, which led to finding what I think is the actual
> issue!

Good luck with that bug !

Bug #15922

Reported by:
jw.hendy
Reported on: 2019-09-03
Last modified on: 2019-09-06

People

Assignee:
Xfce Bug Triage
CC List:
1 user

Version

Attachments

Additional information