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 719423 - Optical disc volumes/mounts are not properly removed if drive disappears
Optical disc volumes/mounts are not properly removed if drive disappears
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: udisks2 volume monitor
1.18.x
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2013-11-27 14:35 UTC by Phillip Susi
Modified: 2018-04-13 08:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
udisks2: Remove optical disc volumes/mounts if drive disappears (8.13 KB, patch)
2018-03-28 15:41 UTC, Ondrej Holy
committed Details | Review

Description Phillip Susi 2013-11-27 14:35:19 UTC
I have been doing some work on udisksd lately and whenever I kill and restart it, the "audio disc" is duplicated, leading to it appearing many times after a while.  Killing gvfs-udisks2-volume-monitor cleans up the mess.
Comment 1 Ondrej Holy 2018-03-28 15:40:05 UTC
This affects empty and audio disks if the corresponding drive is unplugged without ejecting (or the corresponding UDisksDrive object simply disappears from D-Bus for example due to udisksd termination). 

Just a note that "service udisks2 restart" works nicely, but "service udisks2 stop && service udisks2 start" or "pkill udisksd && /usr/libexec/udisks2/udisksd" triggers this issue.
Comment 2 Ondrej Holy 2018-03-28 15:41:48 UTC
Created attachment 370249 [details] [review]
udisks2: Remove optical disc volumes/mounts if drive disappears

If an optical drive is hard-unplugged without ejecting a media first (or
the corresponding UDisksDrive object simply disappears from D-Bus for
example due to the udisksd termination) and an audio disk or an empty
media is inside, corresponding volumes/mounts are not properly removed.
Consequently, the number of the volumes/mounts increase when plugging
and unplugging such drive. This happens because those kinds of volumes/
mounts are handled by their drives in the monitor. Unfortunately, the
drive is removed before processing them and the mounts/volumes without
the drives are ignored consequently.

Let's do not rely on the drives and handle those volumes/mounts over
corresponding UDisksBlock objects, same as it is done for other kinds of
volumes.
Comment 3 Ondrej Holy 2018-04-13 08:34:08 UTC
Attachment 370249 [details] pushed as 0024e34 - udisks2: Remove optical disc volumes/mounts if drive disappears