Sebastien kindly did some more debugging, keeping notes here. This seems to be related to media polling (we verified both in-kernel and udisks based polling trigger this, and cause the same uevents).
Correlating udev events and the corresponding udev debug output, we get:
(udisks-daemon:24900): udisks-daemon-ERROR **: **** HACK: Wanting to register object at path `/org/freedesktop/UDisks/devices/sdb' but there is already an object there. This is an internal error in the daemon. Aborting.
So I think the problem is that the media polling for the /sdb device creates a device in udisks.
Sebastien kindly did some more debugging, keeping notes here. This seems to be related to media polling (we verified both in-kernel and udisks based polling trigger this, and cause the same uevents).
Correlating udev events and the corresponding udev debug output, we get:
UDEV [26112.066235] remove /devices/ pci0000: 00/0000: 00:1d.0/ usb2/2- 1/2-1.4/ 2-1.4:1. 0/host29/ target29: 0:0/29: sdb/sdb1 (block) pci0000: 00/0000: 00:1d.0/ usb2/2- 1/2-1.4/ 2-1.4:1. 0/host29/ target29: 0:0/29: 0:0:0/block/ pci0000: 00/0000: 00:1d.0/ usb2/2- 1/2-1.4/ 2-1.4:1. 0/host29/ target29: 0:0/29: sdb/sdb1
0:0:0/block/
--
**** REMOVING /sys/devices/
sdb/sdb1
**** EMITTING REMOVED for /sys/devices/
0:0:0/block/
UDEV [26112.067123] remove /devices/ pci0000: 00/0000: 00:1d.0/ usb2/2- 1/2-1.4/ 2-1.4:1. 0/host29/ target29: 0:0/29: 0:0:0/block/ sdb (block) pci0000: 00/0000: 00:1d.0/ usb2/2- 1/2-1.4/ 2-1.4:1. 0/host29/ target29: 0:0/29: 0:0:0/block/ pci0000: 00/0000: 00:1d.0/ usb2/2- 1/2-1.4/ 2-1.4:1. 0/host29/ target29: 0:0/29: pci0000: 00/0000: 00:1d.0/ usb2/2- 1/2-1.4/ 2-1.4:1. 0/host29/ scsi_host/ h
--
**** REMOVING /sys/devices/
sdb
**** EMITTING REMOVED for /sys/devices/
0:0:0/block/sdb
**** scsi_host IGNORING REMOVE /sys/devices/
ost29
Now we get a rather weird change uevent with a hilariously broken device path and device name, at a time when sdb is already gone!
UDEV [26112.087644] change /sdb (block)
ACTION=change
DEVNAME=/dev/sdb
DEVPATH=/sdb
DEVTYPE=disk
DISK_MEDIA_CHANGE=1
SUBSYSTEM=block
--
**** TREATING CHANGE AS ADD /sys/sdb
**** ADDING /sys/sdb
**** UPDATING /sys/sdb
**** ADDED /sys/sdb
**** EMITTING ADDED for /sys/sdb
Now we get a similar change event again, but this time WITHOUT DISK_MEDIA_CHANGE
UDEV [26112.102230] change /sdb (block)
ACTION=change
DEVNAME=/dev/sdb
DEVPATH=/sdb
DEVTYPE=disk
SUBSYSTEM=block
--
**** CHANGING /sys/sdb
**** UPDATING /sys/sdb
**** EMITTING CHANGED for /sys/sdb
**** CHANGED /sys/sdb
Now we get the device back:
UDEV [26123.419938] add /devices/ pci0000: 00/0000: 00:1d.0/ usb2/2- 1/2-1.4/ 2-1.4:1. 0/host32/ target32: 0:0/32: 0:0:0/block/ sdb (block) pci0000: 00/0000: 00:1d.0/ usb2/2- 1/2-1.4/ 2-1.4:1. 0/host32/ target32: 0:0/32: 0:0:0/block/ sdb pci0000: 00/0000: 00:1d.0/ usb2/2- 1/2-1.4/ 2-1.4:1. 0/host32/ target32: 0:0/32: 0:0:0/block/ sdb
--
**** ADDING /sys/devices/
**** UPDATING /sys/devices/
(udisks- daemon: 24900): udisks-daemon-ERROR **: **** HACK: Wanting to register object at path `/org/freedeskt op/UDisks/ devices/ sdb' but there is already an object there. This is an internal error in the daemon. Aborting.
So I think the problem is that the media polling for the /sdb device creates a device in udisks.