Comment 28 for bug 404185

Revision history for this message
In , Martin Pitt (pitti) wrote :

Some laptops like the Dell Mini 10 have builtin SD card readers which are wired through an internal USB bus. The current behaviour is that if you click the eject button in nautilus, the card reader device gets ejected and disconnected, and cannot be reactivated ever, except by a reboot.

The cause of this is that DK-d's update_info_drive() sets "can_detach" for all USB devices currently, which causes devkit-disks-helper-drive-detach to be called on them.

So clearly this is too eager. Obviously there is no way to programmatically tell whether a particular USB device can actually be physically detached or whether it's sitting inside a case. So I see the following options right now:

 * If we can tell whether the device has removable media (like card readers), don't detach the reader device. Otherwise, continue to set can_detach. This still errs on the side of breakage, but at least would fix the behaviour with those card readers. I'm currently not sure whether this is feasible, I asked the original reporter for a dk-disks dump to check the properties.

 * Don't set can_detach for all USB devices, and just add udev rules which set ID_DRIVE_DETACHABLE for some known safe cases.

  This would again introduce a whitelist, something which we hoped to get rid of with https://bugzilla.gnome.org/show_bug.cgi?id=576587.

So my question is, why was this current can_detach behaviour introduced? Are there some devices where not even eject is enough? Years ago, when I tested this with an iPod, umount wasn't sufficient, but eject made the "unsafe to remove blabla" warning go away.