Karel Zak 288d394
From 55ad13c26fe5d0e606be5a83937f31b8cf576588 Mon Sep 17 00:00:00 2001
Karel Zak 288d394
From: Karel Zak <kzak@redhat.com>
Karel Zak 288d394
Date: Thu, 28 Apr 2016 13:54:01 +0200
Karel Zak 288d394
Subject: [PATCH] libblkid: make I/O errors on CDROMs non-fatal
Karel Zak 288d394
Karel Zak 288d394
It seems too tricky to get a real size of the data track on hybrid
Karel Zak 288d394
disks with audio+data. It seems overkill to analyze all header in
Karel Zak 288d394
libblkid and on some disks it's probably possible to get I/O error
Karel Zak 288d394
almost everywhere due to crazy copy protection etc.
Karel Zak 288d394
Karel Zak 288d394
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak 288d394
---
Karel Zak 288d394
 libblkid/src/probe.c | 5 ++++-
Karel Zak 288d394
 1 file changed, 4 insertions(+), 1 deletion(-)
Karel Zak 288d394
Karel Zak 288d394
diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c
Karel Zak 288d394
index 63baed3..5d9f701 100644
Karel Zak 288d394
--- a/libblkid/src/probe.c
Karel Zak 288d394
+++ b/libblkid/src/probe.c
Karel Zak 288d394
@@ -615,7 +615,10 @@ static struct blkid_bufinfo *read_buffer(blkid_probe pr, uint64_t real_off, uint
Karel Zak 288d394
 	if (ret != (ssize_t) len) {
Karel Zak 288d394
 		DBG(LOWPROBE, ul_debug("\tread failed: %m"));
Karel Zak 288d394
 		free(bf);
Karel Zak 288d394
-		if (ret >= 0)
Karel Zak 288d394
+
Karel Zak 288d394
+		/* I/O errors on CDROMs are non-fatal to work with hybrid
Karel Zak 288d394
+		 * audio+data disks */
Karel Zak 288d394
+		if (ret >= 0 || blkid_probe_is_cdrom(pr))
Karel Zak 288d394
 			errno = 0;
Karel Zak 288d394
 		return NULL;
Karel Zak 288d394
 	}
Karel Zak 288d394
-- 
Karel Zak 288d394
2.4.11
Karel Zak 288d394