Bug 1209989

Summary: g_unix_mounts_get() ignores btrfs subvolumes
Product: [Fedora] Fedora Reporter: Takehiko Abe <abetakehiko>
Component: glib2Assignee: Matthias Clasen <mclasen>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 21CC: mclasen
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-04-09 01:25:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Takehiko Abe 2015-04-08 15:27:44 UTC
g_unix_mounts_get() ignores btrfs subvolumes

This causes some misbehaviors like nautilus or 'gvfs-ls trash://' fails to list
trashed files. (e.g. http://askubuntu.com/questions/537055/ )

I think the culprit is the following portion of _g_get_unix_mounts() from
gio/gunixmounts.c:

|      /* ignore any mnt_fsname that is repeated and begins with a '/'
|       *
|       * We do this to avoid being fooled by --bind mounts, since
|       * these have the same device as the location they bind to.
|       * It's not an ideal solution to the problem, but it's likely that
|       * the most important mountpoint is first and the --bind ones after
|       * that aren't as important. So it should work.
|       *
|       * The '/' is to handle procfs, tmpfs and other no device mounts.
|       */
|      if (mntent->mnt_fsname != NULL &&
|         mntent->mnt_fsname[0] == '/' &&
|         g_hash_table_lookup (mounts_hash, mntent->mnt_fsname))
|        continue;

https://git.gnome.org/browse/glib/tree/gio/gunixmounts.c#n392

The code is not aware of the btrfs subvolumes.

Comment 1 Matthias Clasen 2015-04-09 01:25:22 UTC
I've filed an upstream bug for this here: https://bugzilla.gnome.org/show_bug.cgi?id=747540
Lets continue the discussion there.