summaryrefslogtreecommitdiffstats
path: root/libblkid/src/probe.c
diff options
context:
space:
mode:
authorKarel Zak2011-11-10 20:18:54 +0100
committerKarel Zak2011-11-10 20:18:54 +0100
commita3ab71cfd3f2b2240e05df3e9cc0800ab4578744 (patch)
tree50121daf1f038432c05438cbce5afbf9ecbbb693 /libblkid/src/probe.c
parentfsck.minix: fix zone_map memory allocation failure check (diff)
downloadkernel-qcow2-util-linux-a3ab71cfd3f2b2240e05df3e9cc0800ab4578744.tar.gz
kernel-qcow2-util-linux-a3ab71cfd3f2b2240e05df3e9cc0800ab4578744.tar.xz
kernel-qcow2-util-linux-a3ab71cfd3f2b2240e05df3e9cc0800ab4578744.zip
libblkid: don't call CDROM_GET_CAPABILITY for partitions
Reported-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid/src/probe.c')
-rw-r--r--libblkid/src/probe.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c
index 2902de9bd..e801c7afd 100644
--- a/libblkid/src/probe.c
+++ b/libblkid/src/probe.c
@@ -707,7 +707,10 @@ int blkid_probe_set_device(blkid_probe pr, int fd,
pr->flags |= BLKID_FL_TINY_DEV;
#ifdef CDROM_GET_CAPABILITY
- if (S_ISBLK(sb.st_mode) && ioctl(fd, CDROM_GET_CAPABILITY, NULL) >= 0)
+ if (S_ISBLK(sb.st_mode) &&
+ !blkid_probe_is_tiny(pr) &&
+ blkid_probe_is_wholedisk(pr) &&
+ ioctl(fd, CDROM_GET_CAPABILITY, NULL) >= 0)
pr->flags |= BLKID_FL_CDROM_DEV;
#endif