GNOME Bugzilla – Bug 625552
wrong behaviour of GVolume GVolumeMonitor related functions with mount --bind
Last modified: 2013-01-24 09:07:49 UTC
* g_volume_monitor_get_volumes() returns volumes that are mounted with the --bind option. These volumes are not assigned a drive (probably correct) and also not a GMount mount point (this is probably incorrect). * Checking whether these drives can be mounted with: g_volume_can_mount() returns TRUE (even if the bind mounted volume is already mounted). Im not sure if this is correct since the documentation says nothing about the return value for devices that are already mounted, might be correct. * g_volume_get_mount() returns NULL (this is probably incorrect) * g_volume_get_drive() returns NULL * Checking for the UUID of the volume gives: NULL trying to mount the device gives an error such as (taken from nautilus): -------------------DIALOG---------------------------------- Unable to mount DATA mount: according to mtab, /media/DATA is already mounted on /home/username/DATA mount failed ------------------DIALOG END------------------------------- The described behaviour produces bug: https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/452049 in nautilus I have already gone through the nautilus source and believe that it is not a nautilus bug, but results from a bug in glib, which is that mount points mounted with --bind do not get a mount point assigned in glib. FYI: the interesting code points in nautilus are: libnautilus-private/nautilus-file-operations.c :2372 (call to g_volume_mount()) :2303 (mount callback invokes error message) src/nautilus-places-sidebar.c:458 (else block, mount --bind points are added)
Please provide the information requested here: http://www.freedesktop.org/wiki/Software/udisks
Created attachment 168470 [details] gvfs-mount -li
Created attachment 168471 [details] libatasmart4 version
Created attachment 168472 [details] gvfs_version
Created attachment 168473 [details] udev_version
Created attachment 168474 [details] fstab
Created attachment 168475 [details] mountinfo
Created attachment 168476 [details] udevadm_info
Created attachment 168477 [details] udisks--dump
Sorry for the delay, i was rather busy in the last days, here are the files requested. Let me know if I can do anything more to help fixing this bug soon and thank you for taking the time to look into it.
Confirm. g_volume_get_mount() always returns NULL for my when g_volume_mount_finish return TRUE and device mounted successfully.
uname -rsvpi Linux 2.6.32.24-1-i686-s32 #1 SMP Sat Nov 6 23:01:27 MSK 2010 Celeron(R) Dual-Core CPU T3100 @ 1.90GHz GenuineIntel udevadm --version 163 glib-2.26.0 cat /etc/fstab #/dev/ram / ext2 defaults 1 1 /dev/sda5 / reiserfs defaults 1 1 /swapfile swap swap defaults 0 0 #/dev/sda4 /mnt reiserfs defaults 1 1 /dev/sda4 /mnt reiser4 defaults 1 1 #/dev/shm tmpfs defaults 0 0 none /dev/shm tmpfs defaults,size=1024M,noexec,nodev,nosuid 0 0 usbfs /proc/bus/usb usbfs defaults 0 0 /dev/uba1 /media/uba1 ext2 defaults,noauto,user 0 0 /dev/sdb1 /media/sdb1 reiserfs defaults,noauto,user 0 0 #/dev/uba1 /media/uba1 auto defaults,noauto,user 0 0 #/dev/uba1 /media/usb vfat noauto,owner 0 0
I believe the necessary checks need to be added in the file glib/gio/gunixvolume.c In g_unix_volume_can_mount(), as this function always returns TRUE at the moment. Another possible option would be to add a check in gunixmounts.c at _g_get_unix_mounts() or _g_get_unix_mount_points() line 840, where the is_user_mountable variable is set. I will keep looking. Cheers Sebastian
Maybe we could also pass the current mount options to guess_system_internal() and then check for the bind option. Afterall a bind mounted mount can be considered an internal mount.
Requesting to mark this as confirmed. See yours comment.
Not a gnome3 blocker, I think.
Not a gnome blocker but never the less confirmed. I also think that it would probably be easy to fix for someone more familiar with glib and gio. In Debian this is considered as important: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=601784
Created attachment 176287 [details] [review] first try, works partially After starting nautilus i get a couple off errors and the mounting process does not work correctly any more, but the bind mounted mount does not appear any more. Initializing nautilus-gdu extension (nautilus:10952): GConf-CRITICAL **: gconf_value_free: assertion `value != NULL' failed (nautilus:10952): GConf-CRITICAL **: gconf_value_free: assertion `value != NULL' failed (nautilus:10952): GdkPixbuf-CRITICAL **: gdk_pixbuf_format_get_name: assertion `format != NULL' failed
I was just wondering if there has been any progress made on this bug.
I don't think we should even show volumes for these, since we (try to) ignore bind mounts as mounts. So, rather than the patch in comment #18 it should do something like if (hasmntopt (mntent, "bind")) continue; Can you try that?
Created attachment 234176 [details] [review] Ignore fstab entries that are bind mounts We don't show the bind mounts anyway, so it only leads to problems when we show the fstab entries, like being unable to mount them.
Like that, does that help?
Review of attachment 234176 [details] [review]: I can confirm that this fixes the bug. I tested it under Ubuntu 12.10 by compiling it into the prefix /opt/gnome/test/ and then running LD_LIBRARY_PATH=/opt/gnome/test/lib /usr/lib/gvfs/gvfs-udisks2-volume-monitor I left the program running, then I needed to kill any running nautilus window and run the normal nautilus without the LD_LIRBARY_PATH env variable. The result is that the bind mount is no longer shown. I also did not experience any negative side effects. So this can be commited now.
P.S Thank you very much Alexander, this bug has been annoying me for a long time. I'm glad you could fix it.
(In reply to comment #21) > Created an attachment (id=234176) [details] [review] > Ignore fstab entries that are bind mounts > > We don't show the bind mounts anyway, so it only leads to > problems when we show the fstab entries, like being unable > to mount them. FWIW, seems like a reasonable thing to me.
Attachment 234176 [details] pushed as b0d5ce1 - Ignore fstab entries that are bind mounts