Comment 39 for bug 34247

Revision history for this message
Robert Lange (rcl24) wrote :

To reiterate, my problem is that trash does not work for my home directory. The problem is with both the Trash Applet and Nautilus. If I mount a floppy or a USB stick or whatever, trash works correctly for those mounts. However, trash will not work for my home directory.

I have NOT tried deactivating dbus as some other posters suggested. Even if that "works" it would cause so many other problems that I don't consider it a solution.

*****
NOTE: My home directory is a part of the / partition, NOT mounted as a separate partition. If I get some free time, I will do a fresh install on a new machine with /home as its own partition. Based on my observations, I hypothesize that setup would work correctly.
*****

Based on the code I have examined as it was executing, both of those applications are working correctly. Gnome-vfs is feeding them the wrong information.

For example, Nautilus makes a call to determine which mount points must be monitored for garbage and what directory to monitor for each mount point. (libnautilus-private/nautilus-trash-monitor.c: nautilus_trash_monitor_get_trash_directories) This function tells Nautilus that the / partition (and therefore my home directory) does not handle trash. Why? Because it in turn calls (libgnomevfs/gnome-vfs-volume.c: gnome_vfs_volume_handles_trash) for each mount point. This function reports that the / partition does not handle trash. So at this point I think I have proven that the error is in gnome-vfs, not Nautilus.

So why does the (gnome_vfs_volume_handles_trash) function report erroneously? The function gets the filesystem type from the GnomeVFSVolume input data structure and passes it to the function (libgnomevfs/gnome-vfs-filesystem-type.c: _gnome_vfs_filesystem_use_trash) which performs a lookup against a table of known filesystem types. For the / partition the filesystem type is listed as "rootfs" which is not found in the table. Therefore, the function assumes that the / mount must not be able to handle trash.

One kludgy solution would be to add "rootfs" to the lookup table and have it return true. However, this solution would be wrong, as the / partition should not handle user trash anytime the /home directory is mounted in another partition. The only way to find a real solution is to find out why the / mount is listed as "rootfs" rather than as "ext3". To do this, we need to find where the GnomeVFSVolume data structures are being generated. For unix systems, they are generated based on GnomeVFSUnixMount structures, which are generated in libgnomevfs/gnome-vfs-unix-mounts.c. I think in comment 37 I documented the diagnosis pretty clearly, although I still don't have much time to work on it further.