Skip to content

client: invalidate mount info cache when a mount is removed

Jonathan Matthew requested to merge jmatthew/gvfs:mount-info-cache into master

If a gvfs client process has accessed a mount, but doesn't have an open connection to the mount process, the mount info cache will not get invalidated when the mount is removed. If another mount appears at the same location, the client process will use the stale mount info to access it and all operations will fail.

This particularly affects Rhythmbox accessing Android devices through mtp mounts, as they are first mounted with no available storage, then when switched to file transfer mode, unmounted and remounted at the same location (since commit 3a7bb06b). Rhythmbox accesses the first mount, then is unable to see the second due to the stale mount info in the cache.

Adding a call to _g_daemon_vfs_invalidate in client/gdaemonvolumemonitor.c:mount_removed fixes this.

Merge request reports