]> git.ipfire.org Git - thirdparty/systemd.git/commit
udev/cdrom_id: Do not open CD-rom in exclusive mode.
authorMichal Suchanek <msuchanek@suse.de>
Sun, 20 Oct 2019 10:12:20 +0000 (12:12 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 23 Oct 2019 22:09:18 +0000 (00:09 +0200)
commit14cd12b3d50f21cb9be7e27785142c6c321fac39
treef3c570f44d9746792d7d754f1e58fd22245bb894
parent69ec2fdd9c7a12c37bb02f7ec7690b6535502dd8
udev/cdrom_id: Do not open CD-rom in exclusive mode.

When you have a CD automunt solution that talks directly to the kernel
independently of udev it races with cdrom_id for exclusive access to the
device failing unpredictably.

The whole is_mounted function in cdrom_id is broken: there is no saying
what happens between calling is_mounted and opening the device.

Hence assume that the device can be mounted asynchronously at any time,
do not use exclusive access, and do away with is_mouted.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
src/udev/cdrom_id/cdrom_id.c