]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: make I/O errors on CDROMs non-fatal
authorKarel Zak <kzak@redhat.com>
Thu, 28 Apr 2016 11:54:01 +0000 (13:54 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 28 Apr 2016 11:54:01 +0000 (13:54 +0200)
It seems too tricky to get a real size of the data track on hybrid
disks with audio+data. It seems overkill to analyze all header in
libblkid and on some disks it's probably possible to get I/O error
almost everywhere due to crazy copy protection etc.

Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/probe.c

index 63baed33e1f15c4fa41ec6648b6358be272f8392..5d9f701f7076bda7cb89cf1a5ed0ec0d1246f14b 100644 (file)
@@ -615,7 +615,10 @@ static struct blkid_bufinfo *read_buffer(blkid_probe pr, uint64_t real_off, uint
        if (ret != (ssize_t) len) {
                DBG(LOWPROBE, ul_debug("\tread failed: %m"));
                free(bf);
-               if (ret >= 0)
+
+               /* I/O errors on CDROMs are non-fatal to work with hybrid
+                * audio+data disks */
+               if (ret >= 0 || blkid_probe_is_cdrom(pr))
                        errno = 0;
                return NULL;
        }