summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoão Paulo Rechi Vita <jprvita@endlessm.com>2016-06-24 14:53:33 -0400
committerMartin Pitt <martin.pitt@ubuntu.com>2016-11-25 09:49:18 +0100
commit9c325f16ea90bee40ccab92d640c1ad8e49872ab (patch)
treefc83cdbc690c04b562cfd04c3e8826d0b1f08dbf
parentfda360c6449bbe41648df69343cd959b91fc8a07 (diff)
downloadudisks-9c325f16ea90bee40ccab92d640c1ad8e49872ab.tar.gz
Don't coldplug uninitilized udev devices
When the udev device is not initialized it may not contain all of its properties yet, which makes udisks provide an incorrect representation of the to its clients. This is particularly problematic during the system initialization phase, where udev is also in it coldplug phase. udev will send an event when each device becomes initialized, so we can safely skip it during coldplug and rely on hotplug even handling instead. https://bugs.freedesktop.org/show_bug.cgi?id=96832
-rw-r--r--src/udiskslinuxprovider.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/udiskslinuxprovider.c b/src/udiskslinuxprovider.c
index fca4c0c..c12e921 100644
--- a/src/udiskslinuxprovider.c
+++ b/src/udiskslinuxprovider.c
@@ -447,6 +447,8 @@ udisks_linux_provider_start (UDisksProvider *_provider)
for (l = devices; l != NULL; l = l->next)
{
GUdevDevice *device = G_UDEV_DEVICE (l->data);
+ if (!g_udev_device_get_is_initialized (device))
+ continue;
udisks_devices = g_list_prepend (udisks_devices, udisks_linux_device_new_sync (device));
}
udisks_devices = g_list_reverse (udisks_devices);