Hello together,

I recently stumbled over cdrom_id opening the device with the O_EXCL flag set, 
if it is not currently mounted:

"fd = open(node, O_RDONLY|O_NONBLOCK|(is_mounted(node) ? 0 : O_EXCL));"

The effect of this is that automatically mounting a cdrom sometimes results in 
"resource busy", if "change" uevents of the devices are processed by udevd 
while the automounter (udisks or something different in my case) is currently 
trying to mount the device triggered by a previous "add" or "change" uevent.

I've to questions to this issue. Maybe someone of you can help me:

1. Is there any particular reason why cdrom_id should open the device 
exclusively (especially since it is not opened exclusively when it is already 

2. If there is any good reason to keep this behavior: How is the best way for 
an automounter to deal with this? Retry? Something different? 

Thx in advance for valuable input.

Best regards

Marko Hoyer

Advanced Driver Information Technology GmbH
Software Group II (ADITG/SW2)
Robert-Bosch-Str. 200
31139 Hildesheim

Tel. +49 5121 49 6948
Fax +49 5121 49 6999

ADIT is a joint venture company of Robert Bosch GmbH/Robert Bosch Car 
Multimedia GmbH and DENSO Corporation
Sitz: Hildesheim, Registergericht: Amtsgericht Hildesheim HRB 3438
Geschaeftsfuehrung: Wilhelm Grabow, Katsuyoshi Maeda
systemd-devel mailing list

Reply via email to