]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libblkid: check for medium on CDMROMs probing
authorKarel Zak <kzak@redhat.com>
Tue, 7 Jan 2020 15:48:34 +0000 (16:48 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 7 Jan 2020 15:48:34 +0000 (16:48 +0100)
commitdc30fd4383e57a0440cdb0e16ba5c4336a43b290
treed61a7a5d76c554b6581412d88f1a4f29ac8ba394
parent4ae96cf77b36660255d5870a4209480bbec47902
libblkid: check for medium on CDMROMs probing

The commit 39f5af25982d8b0244000e92a9d0e0e6557d0e17 introduces
O_NONBLOCK to avoid the tray close on open(). The side effect is that
open() is successful when there is no medium.

This is usually no problem for standard tools because the next read()
will fail. Unfortunately, libblkid ignores I/O errors for (and only
for) CDROMs to support some crazy hybrid data+audio disks. The final
result is many I/O errors in system log when O_NONBLOCK is enabled.

This patch add CDROM_DRIVE_STATUS to stop probing when there is no
disk or when the tray is open.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1787973
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/probe.c
misc-utils/blkid.c