summaryrefslogtreecommitdiffstats
path: root/libblkid/src/verify.c
diff options
context:
space:
mode:
authorKarel Zak2014-06-10 12:16:59 +0200
committerKarel Zak2014-06-10 12:16:59 +0200
commit20e1c3dc03399d6988ef35dedc1364cfc12e9263 (patch)
treea408b0e5509cefef16d8ef32b7affdd707f830bd /libblkid/src/verify.c
parenttests: fix fdisk/bsd for big endian systems (diff)
downloadkernel-qcow2-util-linux-20e1c3dc03399d6988ef35dedc1364cfc12e9263.tar.gz
kernel-qcow2-util-linux-20e1c3dc03399d6988ef35dedc1364cfc12e9263.tar.xz
kernel-qcow2-util-linux-20e1c3dc03399d6988ef35dedc1364cfc12e9263.zip
libblkid: ignore private LVM devices
The virtual private LVM devices do not contain any blkid relevant data and it does not make any sense to scan for superblocks or partitions on the devices, because we can interpret data from the devices in bad way. Unfortunately, for LVM has "private" very special meaning. The private LVM devices are accessible and readable (according to LVM guys it's feature, because debugging etc.). The problem is pretty visible with LVM thin provisioning where a virtual pool device contains segments from the top-level thin devices. Mountable top-level LVM-thin device: # blkid -o udev -p /dev/mapper/vg-thin1 ID_FS_UUID=57ed6490-903b-416c-91d2-6d06804ec60c ID_FS_TYPE=ext4 Virtual private LVM-pool device (contains data from all thin devices): # blkid -o udev -p /dev/mapper/vg-pool0 ID_FS_UUID=57ed6490-903b-416c-91d2-6d06804ec60c ID_FS_TYPE=ext4 ... this is incorrect, vg-pool0 is unmountable. LVM uses special UUID suffixes for private devices. All devices with uuid in format "LVM-<uuid>-<type>" are private. This patch modifies libblkid to not scan such devices. The high-level API ignores such devices at all now. The low-level API allows to assign the device to blkid_prober, but all scan functions always return nothing and library does not read anything from the device. The another functionality (get parental device, topology, sector sizes, etc.) still works as expected. The change affects only probing code. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1101345 Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid/src/verify.c')
-rw-r--r--libblkid/src/verify.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libblkid/src/verify.c b/libblkid/src/verify.c
index d8ad79d68..b245daa01 100644
--- a/libblkid/src/verify.c
+++ b/libblkid/src/verify.c
@@ -112,6 +112,10 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
(unsigned long)diff));
#endif
+ if (blkid_lvm_private(st.st_rdev)) {
+ blkid_free_dev(dev);
+ return NULL;
+ }
if (!cache->probe) {
cache->probe = blkid_new_probe();
if (!cache->probe) {