Comment 4 for bug 1442649

Revision history for this message
Christian Juner (christian-juner) wrote : Re: nautilus trash doesn't include btrfs subvolumes

The trouble seems to stem from glib's way of deleting files being different to the way gvfs tries to locate trash directories.

glib's gio/glocalfile.c contains the find_mountpoint_for function which is used to determine the device's root directory as location to put the .Trash-<uid> directory. It looks at the stat(2) st_dev value ("device number"). btrfs gives each subvolume a different device number.

gvfs's trashlib searches for trash directories based on mount points determined by getmntent_r(2).

I do not know how to fix it in general. A fix for btrfs might be to search for all subvolumes of a btrfs mount point returned by getmntent_r(2). Not sure if you can listen to new subvolumes being created after the initial search, though (maybe inotify can?).