]> sourceware.org Git - lvm2.git/commitdiff
activation: guard exclusive activation
authorZdenek Kabelac <zkabelac@redhat.com>
Mon, 15 Jan 2018 15:26:00 +0000 (16:26 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 17 Jan 2018 13:45:47 +0000 (14:45 +0100)
Add protectional internall error whenever we spot activation
of 'exclusive' only segments in 'non-exclusive' mode.

TODO: possibly the activation locking could be enhanced to handle
this fully behind the scene - as for now this works purely for
lvchange/vgchange activation.

WHATS_NEW
lib/activate/activate.c

index 00334b5e072af53762117d022d4067a5fa92c332..bc73cd775265ee9a5f5a673f2edab0e6bfb5a84e 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.178 - 
 =====================================
+  Avoid non-exclusive activation of exclusive segment types.
   Fix trimming sibling PVs when doing a pvmove of raid subLVs.
   Preserve exclusive activation during thin snaphost merge.
   Suppress some repeated reads of the same disk data at the device layer.
index 4c69af78deb0b5fbe5d1128287766b912bfd2a9c..b23400addca0b7c6eb70ce1a4911bb096e607d81 100644 (file)
@@ -2568,6 +2568,16 @@ static int _lv_activate(struct cmd_context *cmd, const char *lvid_s,
        struct lvinfo info;
        int r = 0;
 
+       if (!laopts->exclusive &&
+           (lv_is_origin(lv) ||
+            lv_is_pvmove(lv) ||
+            seg_only_exclusive(first_seg(lv))))  {
+               log_error(INTERNAL_ERROR "Trying non-exlusive activation of %s with "
+                         "a volume type %s requiring exclusive activation.",
+                         display_lvname(lv), lvseg_name(first_seg(lv)));
+               return 0;
+       }
+
        if (!activation())
                return 1;
 
This page took 0.04676 seconds and 5 git commands to generate.