]> sourceware.org Git - lvm2.git/commitdiff
scanning: skip more private devices
authorZdenek Kabelac <zkabelac@redhat.com>
Fri, 9 Mar 2018 13:49:38 +0000 (14:49 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Tue, 13 Mar 2018 11:57:33 +0000 (12:57 +0100)
Just like lvm2 has internal devices like _tdata which is using UUID with
suffix, there is similar private type of device for crypto device where
they are using CRYPT-TEMP uuid prefix.

Also ignore stratis.

WHATS_NEW
lib/activate/dev_manager.c

index a27b307c1750da8c8156a7327767bd880359b5c4..1d9e61cac2839401cf93960b9f3d89a532f22296 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.178 - 
 =====================================
+  Skip private crypto and stratis devices.
   Skip frozen raid devices from scanning.
   Activate RAID SubLVs on read_only_volume_list readwrite
   Offer convenience type raid5_n converting to raid10
index 499bf9a84b2baca817d4f21cc370c9bb4f11d1ed..ae3db8027627d3d30a15f847f8e0cbd618243f99 100644 (file)
@@ -32,6 +32,8 @@
 
 #define MAX_TARGET_PARAMSIZE 50000
 #define LVM_UDEV_NOSCAN_FLAG DM_SUBSYSTEM_UDEV_FLAG0
+#define CRYPT_TEMP     "CRYPT-TEMP"
+#define STRATIS                "stratis-"
 
 typedef enum {
        PRELOAD,
@@ -637,6 +639,17 @@ int device_is_usable(struct device *dev, struct dev_usable_check_params check)
                }
        }
 
+       if (check.check_reserved && uuid &&
+           (!strncmp(uuid, CRYPT_TEMP, sizeof(CRYPT_TEMP) - 1) ||
+            !strncmp(uuid, STRATIS, sizeof(STRATIS) - 1))) {
+               /* Skip private crypto devices */
+               log_debug_activation("%s: Reserved uuid %s on %s device %s not usable.",
+                                    dev_name(dev), uuid,
+                                    uuid[0] == 'C' ? "crypto" : "stratis",
+                                    name);
+               goto out;
+       }
+
        /* FIXME Also check for mpath no paths */
        do {
                next = dm_get_next_target(dmt, next, &start, &length,
This page took 0.058235 seconds and 5 git commands to generate.