summaryrefslogtreecommitdiffstats
path: root/libblkid/src/probe.c
diff options
context:
space:
mode:
authorKarel Zak2017-07-12 14:35:53 +0200
committerKarel Zak2017-07-12 14:35:53 +0200
commit884659b32a8c632658e00700264570fb027a44d9 (patch)
treef6e4609617ae2a2d0c2bb29117105c50166c0d58 /libblkid/src/probe.c
parenttests: don't use errno in output (diff)
downloadkernel-qcow2-util-linux-884659b32a8c632658e00700264570fb027a44d9.tar.gz
kernel-qcow2-util-linux-884659b32a8c632658e00700264570fb027a44d9.tar.xz
kernel-qcow2-util-linux-884659b32a8c632658e00700264570fb027a44d9.zip
libblkid: don't use CDROM_GET_CAPABILITY ioctl for DM devices
For some reason kernel commit e980f62353c697cbf0c4325e43df6e44399aeb64 add extra warning when the ioctl is used for DM devices. It seems we can avoid this ioctl when the device has dm/uuid. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1469532 Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid/src/probe.c')
-rw-r--r--libblkid/src/probe.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c
index 9f56f528f..21cd790e9 100644
--- a/libblkid/src/probe.c
+++ b/libblkid/src/probe.c
@@ -862,6 +862,7 @@ int blkid_probe_set_device(blkid_probe pr, int fd,
{
struct stat sb;
uint64_t devsiz = 0;
+ char *dm_uuid = NULL;
blkid_reset_probe(pr);
blkid_probe_reset_buffers(pr);
@@ -925,7 +926,8 @@ int blkid_probe_set_device(blkid_probe pr, int fd,
if (pr->size <= 1440 * 1024 && !S_ISCHR(sb.st_mode))
pr->flags |= BLKID_FL_TINY_DEV;
- if (S_ISBLK(sb.st_mode) && sysfs_devno_is_lvm_private(sb.st_rdev)) {
+ if (S_ISBLK(sb.st_mode) &&
+ sysfs_devno_is_lvm_private(sb.st_rdev, &dm_uuid)) {
DBG(LOWPROBE, ul_debug("ignore private LVM device"));
pr->flags |= BLKID_FL_NOSCAN_DEV;
}
@@ -933,6 +935,7 @@ int blkid_probe_set_device(blkid_probe pr, int fd,
#ifdef CDROM_GET_CAPABILITY
else if (S_ISBLK(sb.st_mode) &&
!blkid_probe_is_tiny(pr) &&
+ !dm_uuid &&
blkid_probe_is_wholedisk(pr) &&
ioctl(fd, CDROM_GET_CAPABILITY, NULL) >= 0) {
@@ -940,6 +943,7 @@ int blkid_probe_set_device(blkid_probe pr, int fd,
cdrom_size_correction(pr);
}
#endif
+ free(dm_uuid);
DBG(LOWPROBE, ul_debug("ready for low-probing, offset=%"PRIu64", size=%"PRIu64"",
pr->off, pr->size));