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 552168 - volume's mount not mounted after g_volume_mount_finish()
volume's mount not mounted after g_volume_mount_finish()
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: [obsolete] hal volume monitor
git master
Other All
: Normal minor
: ---
Assigned To: David Zeuthen (not reading bugmail)
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2008-09-13 21:38 UTC by Mike Rooney
Modified: 2008-09-29 17:43 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
patch that was committed (4.25 KB, patch)
2008-09-29 15:57 UTC, David Zeuthen (not reading bugmail)
committed Details | Review
doc patch for gio (991 bytes, patch)
2008-09-29 16:06 UTC, David Zeuthen (not reading bugmail)
committed Details | Review

Description Mike Rooney 2008-09-13 21:38:13 UTC
When you click on an unmounted volume, it should mount it (as it does) and then show it. Instead the selection reverts back to the current location and the contents don't change until you click the volume a second time.

Other information:
Forwarded from https://bugs.launchpad.net/bugs/269901 :

"When you click a place on nautilus' places sidebar, you're taken to it. Volumes, however, seem to work differently. If you click once on an unmounted volume you're asked for permission (password) to mount it, but nothing else happens. You have to click it once again for nautilus to actually display it."
Comment 1 Christian Neumair 2008-09-17 16:42:45 UTC
Reassigning to gvfs.

David: Nautilus uses g_volume_mount(), in libnautilus-private/nautilus-file-operations.c:nautilus_file_operations_mount_volume_full(). After finishing the mount in the libnautilus-private/nautilus-file-operations.c:volume_mount_cb() callback we proxy to another callback. In this case, it's src/nautilus-places-sidebar.c:volume_mounted_cb().

Unfortunately, directly after finishing the mount, g_volume_get_mount (volume) seems to return NULL, and we used it for going to the mount's root location. I think this happened when the volume monitor moved out-of-process. Is this by design - i.e. should we wait for “mount-added” - or is it a gvfs regression?
Comment 2 Christian Neumair 2008-09-17 17:23:51 UTC
Actually reassigning to gvfs, changing title.
Comment 3 David Zeuthen (not reading bugmail) 2008-09-24 15:27:01 UTC
(In reply to comment #1)
> Unfortunately, directly after finishing the mount, g_volume_get_mount (volume)
> seems to return NULL, and we used it for going to the mount's root location. I
> think this happened when the volume monitor moved out-of-process. Is this by
> design - i.e. should we wait for “mount-added” - or is it a gvfs
> regression?

Yeah, probably g_volume_get_mount() should return non-NULL after calling g_volume_mount_finish() and not getting an error...

Do you get the mount-added signal though? And if so, does g_volume_get_mount() return something non-NULL?
Comment 4 Matthias Clasen 2008-09-26 19:29:27 UTC
The same problem can now be seen in the file chooser.
Comment 5 David Zeuthen (not reading bugmail) 2008-09-26 19:37:54 UTC
I'll work on a fix over the weekend; ping me Monday if there isn't a patch yet.
Comment 6 David Zeuthen (not reading bugmail) 2008-09-26 19:45:06 UTC
Will also check/fix the other volume monitors (gphoto2, daemon, unix). Also, we want a fix for the docs g_volume_mount() to specify this behavior (today it's undefined).
Comment 7 David Zeuthen (not reading bugmail) 2008-09-29 14:46:15 UTC
I can't seem to reproduce this problem with gvfs trunk... any hints on how to reproduce it? Thanks.
Comment 8 David Zeuthen (not reading bugmail) 2008-09-29 15:07:26 UTC
Actually I can reproduce this just fine now (funny thing is that it's fine on the daemon side; not so on the proxy side) so disregard comment 7. Working on a fix.
Comment 9 David Zeuthen (not reading bugmail) 2008-09-29 15:57:20 UTC
Created attachment 119598 [details] [review]
patch that was committed

OK, so we actually did handle this; unfortunately the mount-added signal was emitted in idle so the D-Bus message resulting from this was sent after the reply for the Mount method.

Am pretty sure we should remove all locking from the hal volume monitor now that it runs in a separate daemon.

Anyway, committed the attached patch.

2008-09-29  David Zeuthen  <davidz@redhat.com>

        * monitor/hal/ghalvolume.c:
        * monitor/hal/ghalvolumemonitor.[ch]:
        Make sure we emit 'mount-added' when forcing an update for
        completing a mount operation (#552168)
Comment 10 David Zeuthen (not reading bugmail) 2008-09-29 15:57:58 UTC
Please reopen if the fix doesn't work - it works for me.
Comment 11 David Zeuthen (not reading bugmail) 2008-09-29 16:06:28 UTC
Created attachment 119600 [details] [review]
doc patch for gio

Matthias, here's a patch for gio clarifying the docs
Comment 12 David Zeuthen (not reading bugmail) 2008-09-29 17:23:30 UTC
I deleted a bit too much when cleaning up the patch; also need this patch

http://svn.gnome.org/viewvc/gvfs/trunk/monitor/proxy/gproxyvolume.c?r1=1931&r2=2037

Committed.

2008-09-29  David Zeuthen  <davidz@redhat.com>

        * monitor/proxy/gproxyvolume.c (mount_cb): Complete the mounting
        operation in idle to ensure we've processed pending dbus messages
        for creating the new mount object

Comment 13 Matthias Clasen 2008-09-29 17:39:42 UTC
Doc addition looks fine to me, please commit
Comment 14 David Zeuthen (not reading bugmail) 2008-09-29 17:41:16 UTC
gvfs fixes also now committed on the gnome-2-24 branch:

2008-09-29  David Zeuthen  <davidz@redhat.com>

        * monitor/hal/ghalvolume.c:
        * monitor/hal/ghalvolumemonitor.[ch]:
        * monitor/proxy/gproxyvolume.c:
        Make sure we emit 'mount-added' when forcing an update for
        completing a mount operation (#552168). Cherry-picked from trunk.

Comment 15 David Zeuthen (not reading bugmail) 2008-09-29 17:43:50 UTC
(In reply to comment #13)
> Doc addition looks fine to me, please commit

Committed on trunk. Thanks.