diff options
author | Karel Zak | 2016-04-27 18:49:36 +0200 |
---|---|---|
committer | Karel Zak | 2016-04-27 18:49:36 +0200 |
commit | 6548ac6aa797b3e64ea1ea28a3fb41464b35bc05 (patch) | |
tree | 9b3fdf7bde4a1febbd8e0f83b31513e8871de1b2 /libblkid/src/probe.c | |
parent | libblkid: check for multi-session CDROMs (diff) | |
download | kernel-qcow2-util-linux-6548ac6aa797b3e64ea1ea28a3fb41464b35bc05.tar.gz kernel-qcow2-util-linux-6548ac6aa797b3e64ea1ea28a3fb41464b35bc05.tar.xz kernel-qcow2-util-linux-6548ac6aa797b3e64ea1ea28a3fb41464b35bc05.zip |
Revert "libblkid: check for multi-session CDROMs"
This reverts commit a14cc9a5046bc4954b4110323c83599f90f9f35e.
We need a better way (probably analyze track ioctls CDROMREADTOCHDR
and CDROMREADTOCENTRY) to get also proper track size.
The original patch works only if data track is the last track.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid/src/probe.c')
-rw-r--r-- | libblkid/src/probe.c | 51 |
1 files changed, 6 insertions, 45 deletions
diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c index e46615702..63baed33e 100644 --- a/libblkid/src/probe.c +++ b/libblkid/src/probe.c @@ -772,54 +772,15 @@ failed: } /* - * Issue #1: - * - * On hybrid mutil-session media (audio+data) we get I/O errors almost - * everywhere. The solution is to specify probing offset to the wanted - * session. Udev uses this way when it calls libblkid (the proper data session - * offset is based on ID_CDROM_MEDIA_SESSION_LAST_OFFSET from by udev cdrom_id - * tool). - * - * Unfortunately, it means that blkid will be blind when executed without a - * probing offset, to avoid this problem we use CDROMMULTISESSION ioctl to get - * last session offset. This way also uses iso9660 fyslesystem kernel driver - * when you mount mutil-session CD without a sesssion= mount option. - * - * Issue #2: - * - * Linux kernel reports (BLKGETSIZE) cdrom device size greater than area - * readable by read(2). We have to reduce the probing area to avoid unwanted - * I/O errors in probing functions. It seems that unreadable are always last 2 - * or 3 CD blocks (CD block size is 2048 bytes, it means 12 in 512-byte - * sectors). + * Linux kernel reports (BLKGETSIZE) cdrom device size greater than area + * readable by read(2). We have to reduce the probing area to avoid unwanted + * I/O errors in probing functions. It seems that unreadable are always last 2 + * or 3 CD blocks (CD block size is 2048 bytes, it means 12 in 512-byte + * sectors). */ static void cdrom_size_correction(blkid_probe pr) { - uint64_t size, n, nsectors; - - /* move offset */ -#ifdef CDROMMULTISESSION - if (pr->off == 0) { - struct cdrom_multisession ms_info = { 0 }; - int i; - - ms_info.addr_format = CDROM_LBA; - i = ioctl(pr->fd, CDROMMULTISESSION, (unsigned long) &ms_info); - if (i == 0 && ms_info.xa_flag) { - DBG(LOWPROBE, ul_debug("CDROM: multisession last session start: %u (CD sectors)", ms_info.addr.lba)); - - pr->off = (uint64_t) ms_info.addr.lba * 2048; - DBG(LOWPROBE, ul_debug("CDROM: moving probing offset from 0 to %ju", pr->off)); - - size = pr->size - pr->off; - DBG(LOWPROBE, ul_debug("CDROM: reduce probing size from %ju to %ju", pr->size, size)); - pr->size = size; - } - } -#endif - - /* reduce size */ - nsectors = pr->size >> 9; + uint64_t n, nsectors = pr->size >> 9; for (n = nsectors - 12; n < nsectors; n++) { if (!is_sector_readable(pr->fd, n)) |