GNOME Bugzilla – Bug 708316
gphoto2: Exit cleanly when device is removed
Last modified: 2015-03-10 13:48:21 UTC
I didn't test this, but I would expect it to create the same bug as for the afc backend, which fails to exit when this is called. https://bugzilla.gnome.org/show_bug.cgi?id=708288
Created attachment 255234 [details] [review] gphoto2: Exit cleanly when device is removed As the other backends do, and removes 2 FIXMEs.
Review of attachment 255234 [details] [review]: It looks good with small fix. ::: daemon/gvfsbackendgphoto2.c @@ +828,3 @@ caches_invalidate_all (gphoto2_backend); + g_vfs_backend_force_unmount ((GVfsBackend *) gphoto2_backend); Would be nice to use preferably G_VFS_BACKEND (gphoto2_backend). @@ +1046,3 @@ caches_invalidate_all (gphoto2_backend); + g_vfs_backend_force_unmount ((GVfsBackend *) gphoto2_backend); Ditto.
Except that it's broken anyway, because g_vfs_backend_force_unmount() doesn't work.
Created attachment 277804 [details] [review] gphoto2: Exit cleanly when device is removed As the other backends do, and removes 2 FIXMEs.
(In reply to comment #3) > Except that it's broken anyway, because g_vfs_backend_force_unmount() doesn't > work. Why doesn't it work? It works for the sftp backend, in my testing, so I don't see why it wouldn't work for the other backends.
(In reply to comment #5) > (In reply to comment #3) > > Except that it's broken anyway, because g_vfs_backend_force_unmount() doesn't > > work. > > Why doesn't it work? It works for the sftp backend, in my testing, so I don't > see why it wouldn't work for the other backends. Shadowed mounts is my guess. Both the gphoto2 and the afc backend suffer from mounts not disappearing, and the main difference with the other backends using force unmount is shadowed mounts.
Review of attachment 277804 [details] [review]: Looks good.
Review of attachment 277804 [details] [review]: I'm not committing it, it doesn't work.
What exactly doesn't work? It seems working for me... $ GVFS_DEBUG=1 /opt/gnome/libexec/gvfsd --replace Connect device: initing 0x256d070 Added new job source 0x256d070 (GVfsBackendGphoto2) Queued new job 0x2553ef0 (GVfsJobMount) try_mount 0x256d070 host=[usb:002,004] do_mount 0x256d070 host='[usb:002,004]' decoded host='usb:002,004' Parsed 'usb:002,004' into device name /dev/bus/usb/002/004 -> sysfs path /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2, subsys usb, name 2-1.2 gphoto2_port='usb:002,004'Using ignore_prefix='/store_00010001/' can_write = 1 can_delete = 1 send_reply, failed: 0 mounted 0x256d070 Remove device: on_uevent action remove, device (null) on_uevent action remove, device /dev/bus/usb/002/004 we have been removed! caches_invalidate_all() forced_unregister_mount_callback finalizing 0x256d070
For the record, g_vfs_backend_force_unmount() does work in the afc backend.
Bastien?
No idea. Commit it and wait for bugs to roll in?
Please push it if you didn't push it before only because it doesn't work for afc and you didn't test it with gphoto2... It works for me with my mobile phone, backend is terminated correctly.
Attachment 277804 [details] pushed as a4f0bf3 - gphoto2: Exit cleanly when device is removed