Bug#884067: GIO lists removable storage devices even after they have been unplugged when using Linux kernel v4.14

Torbjörn Andersson eriktorbjorn at telia.com
Mon Dec 11 06:52:48 UTC 2017


Package: libglib2.0-0
Version: 2.54.2-1

Dear maintainer,

After upgrading the Linux kernel to linux-image-4.14.0-1-amd64 , version 
4.14.2-1 (I'm using Debian sid), I noticed that when plugging in my 
phone via USB I would see an icon for it in my file manager (Thunar) and 
on my desktop (Xfce), but when unplugging the phone the icon would no 
longer disappar. Plugging in the phone again would give me a second 
icon. Doing it again a third, and so on.

This did not happen when I tried KDE's file manager, Dolphin, which 
suggests that the problem might be Glib-related, unless it's even 
further down. I'm still not sure where it actually gets the information, 
but the following program gave me the same list as the file manager, 
including the duplicates:

#include <gio/gio.h>
#include <stdio.h>

int main() {
   GVolumeMonitor *monitor = g_volume_monitor_get();
   GList *volumes = g_volume_monitor_get_volumes(monitor);
   GList *lp;

   for (lp = volumes; lp != NULL; lp = lp->next) {
     GVolume *volume = lp->data;
     char *volume_name = g_volume_get_name(volume);
     printf("%s\n", g_volume_get_name(volume));
     g_free(volume_name);
   }

   g_object_unref(monitor);
   g_list_free(volumes);

   return 0;
}

I don't know if it's relevant, but I also tried running "udevadm 
monitor" while plugging in and removing the phone. This is what I got 
with a 4.13 kernel (4.13.13-1):

KERNEL[50.806104] add      /devices/pci0000:00/0000:00:14.0/usb3/3-9 (usb)
KERNEL[50.806778] add 
/devices/pci0000:00/0000:00:14.0/usb3/3-9/3-9:1.0 (usb)
UDEV  [50.811697] add      /devices/pci0000:00/0000:00:14.0/usb3/3-9 (usb)
UDEV  [50.815390] add 
/devices/pci0000:00/0000:00:14.0/usb3/3-9/3-9:1.0 (usb)
KERNEL[54.278046] remove 
/devices/pci0000:00/0000:00:14.0/usb3/3-9/3-9:1.0 (usb)
KERNEL[54.278584] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-9 (usb)
UDEV  [54.279883] remove 
/devices/pci0000:00/0000:00:14.0/usb3/3-9/3-9:1.0 (usb)
UDEV  [54.281104] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-9 (usb)

And this is what I got with the aforementioned 4.14 kernel:

KERNEL[69.838042] add      /devices/pci0000:00/0000:00:14.0/usb1/1-9 (usb)
KERNEL[69.838679] add 
/devices/pci0000:00/0000:00:14.0/usb1/1-9/1-9:1.0 (usb)
KERNEL[69.838770] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-9 (usb)
UDEV  [69.843453] add      /devices/pci0000:00/0000:00:14.0/usb1/1-9 (usb)
UDEV  [69.845072] add 
/devices/pci0000:00/0000:00:14.0/usb1/1-9/1-9:1.0 (usb)
UDEV  [69.849294] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-9 (usb)
KERNEL[73.666646] remove 
/devices/pci0000:00/0000:00:14.0/usb1/1-9/1-9:1.0 (usb)
KERNEL[73.667196] unbind   /devices/pci0000:00/0000:00:14.0/usb1/1-9 (usb)
KERNEL[73.667273] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-9 (usb)
UDEV  [73.668520] remove 
/devices/pci0000:00/0000:00:14.0/usb1/1-9/1-9:1.0 (usb)
UDEV  [73.670060] unbind   /devices/pci0000:00/0000:00:14.0/usb1/1-9 (usb)
UDEV  [73.670446] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-9 (usb)

Regards,

Torbjörn Andersson



More information about the pkg-gnome-maintainers mailing list