diff options
author | Karel Zak | 2014-06-10 12:16:59 +0200 |
---|---|---|
committer | Karel Zak | 2014-06-10 12:16:59 +0200 |
commit | 20e1c3dc03399d6988ef35dedc1364cfc12e9263 (patch) | |
tree | a408b0e5509cefef16d8ef32b7affdd707f830bd /libblkid/src/blkidP.h | |
parent | tests: fix fdisk/bsd for big endian systems (diff) | |
download | kernel-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/blkidP.h')
-rw-r--r-- | libblkid/src/blkidP.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libblkid/src/blkidP.h b/libblkid/src/blkidP.h index 0ac11737e..538a368b5 100644 --- a/libblkid/src/blkidP.h +++ b/libblkid/src/blkidP.h @@ -219,6 +219,7 @@ struct blkid_struct_probe #define BLKID_FL_PRIVATE_FD (1 << 1) /* see blkid_new_probe_from_filename() */ #define BLKID_FL_TINY_DEV (1 << 2) /* <= 1.47MiB (floppy or so) */ #define BLKID_FL_CDROM_DEV (1 << 3) /* is a CD/DVD drive */ +#define BLKID_FL_NOSCAN_DEV (1 << 4) /* do not scan this device */ /* private per-probing flags */ #define BLKID_PROBE_FL_IGNORE_PT (1 << 1) /* ignore partition table */ @@ -347,6 +348,7 @@ extern void blkid__scan_dir(char *, dev_t, struct dir_list **, char **) __attribute__((nonnull(1,4))); extern int blkid_driver_has_major(const char *drvname, int major) __attribute__((warn_unused_result)); +extern int blkid_lvm_private(dev_t devno); /* lseek.c */ extern blkid_loff_t blkid_llseek(int fd, blkid_loff_t offset, int whence); |