Mount fails when trying to enumerate files immediately
Submitted by Marco Pesenti Gritti
Assigned to gvf..@..e.bugs
Link to original bug (#612180)
Description
I have an applications which does the following:
1 Listen to volume-added signal on GVolumeMonitor 2 Listen to mount-added signal on GVolumeMonitor 3 Call mount when a new GVolume appears 4 Use g_file_enumerator on a mount as soon as it appears.
The result is a dbus timeout reported on the GVolume mount method callback.
Here is what I think it's going on:
1 do_mount is called in gphoto2 backend 2 g_vfs_job_finish is called before initializing the backend lock 3 the mount is registered with the mount tracker 4 the mount is added dbus signal is emitted 5 mount-added for GVolume is emitted 6 the application uses g_file_enumator on the new mount 7 try_enumerate is called in the gvfs daemon 8 g_mutex_lock is called with NULL mutex and the daemon crashes
I don't quite understand how 2-7 happens serially since all the dbus communication is async.
Moving g_vfs_job_finish at the end of do_mount seems to fix it.
Version: 0.2.x