After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 794154 - udisks2: Improve bind mount handling
udisks2: Improve bind mount handling
Status: RESOLVED OBSOLETE
Product: gvfs
Classification: Core
Component: udisks2 volume monitor
unspecified
Other All
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on: 782814
Blocks:
 
 
Reported: 2018-03-07 14:15 UTC by Ondrej Holy
Modified: 2018-09-21 18:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
udisks2: Improve bind mount handling (4.56 KB, patch)
2018-03-07 14:16 UTC, Ondrej Holy
none Details | Review
udisks2: Do not ignore mounts without volumes (1.65 KB, patch)
2018-04-27 17:28 UTC, Ondrej Holy
none Details | Review
udisks2: Improve handling of mounts which doesn't point into fs root (2.88 KB, patch)
2018-04-27 17:29 UTC, Ondrej Holy
none Details | Review
udisks2: Improve handling of mounts which doesn't point into fs root (2.93 KB, patch)
2018-05-11 08:54 UTC, Ondrej Holy
none Details | Review

Description Ondrej Holy 2018-03-07 14:15:56 UTC
There is no way to detect bind mounts over UDisks2/GLib APIs currently
if mount point (i.e. fstab entry) doesn't exists. However, we can improve
handling of bind mounts with existing mount points. If device path of the
correspoing mount point resides on another mount, it is supposedly a bind
mount and it can be joined with corresponding fstab volume, not with
udisks volume. New APIs for UDisks2/GLib are needed in order to fix this
also for mounts without fstab entries...

So for the following fstab:

/dev/sda1  /     ext4  defaults          1 1
/mnt/foo   /foo  none  bind,x-gvfs-show  0 0

Output from "gio mount -l" will be:

Drive(0): drive
  Type: GProxyDrive (GProxyVolumeMonitorUDisks2)
Volume(1): foo
  Type: GProxyVolume (GProxyVolumeMonitorUDisks2)
  Mount(0): foo -> file:///mnt/foo
    Type: GProxyMount (GProxyVolumeMonitorUDisks2)

Instead of the current:

Drive(0): drive
  Type: GProxyDrive (GProxyVolumeMonitorUDisks2)
  Volume(0): root
    Type: GProxyVolume (GProxyVolumeMonitorUDisks2)
    Mount(0): root -> file:///mnt/foo
      Type: GProxyMount (GProxyVolumeMonitorUDisks2)
Volume(1): foo
  Type: GProxyVolume (GProxyVolumeMonitorUDisks2)
Comment 1 Ondrej Holy 2018-03-07 14:16:02 UTC
Created attachment 369407 [details] [review]
udisks2: Improve bind mount handling
Comment 2 Ondrej Holy 2018-03-07 14:18:22 UTC
This change depends on patch to not filter out bind mount points from Bug 782814...
Comment 3 Ondrej Holy 2018-04-27 17:28:56 UTC
Created attachment 371470 [details] [review]
udisks2: Do not ignore mounts without volumes

gvfs_udisks2_mount_new returns NULL if volume is not specified and
mount is considered as internal by g_unix_mount_is_system_internal.
This prevents mount creation in certain cases even if x-gvfs-show is
manually specified. Mounts are already filtered out by
should_include_mounts, so I don't see much reason for additional check.

It is true that should_include_mount doesn't use
g_unix_mount_is_system_internal, but just
g_unix_is_mount_path_system_internal, however, we can change this
in future if needed.
Comment 4 Ondrej Holy 2018-04-27 17:29:03 UTC
Created attachment 371471 [details] [review]
udisks2: Improve handling of mounts which doesn't point into fs root

UDisks2 handling of mounts which doesn't point into fs root (created
over bind operation, or btrfs subvolumes) is not optimal, see:
https://github.com/storaged-project/udisks/issues/478

Also GIO API doesn't expect that one GVolume can have multiple
mountpoints. Thus don't try to match UDisksBlock with mount which
doesn't point into fs root and create standalone GVfsUDisks2Mount
for it (or use GVfsUDisks2Volume corresponding with fstab entry).
Comment 5 Ondrej Holy 2018-05-11 08:54:54 UTC
Created attachment 371933 [details] [review]
udisks2: Improve handling of mounts which doesn't point into fs root

Fixed usage of uninitialized value...
Comment 6 GNOME Infrastructure Team 2018-09-21 18:18:53 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gvfs/issues/330.