Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=44b98d77ecda701902c6c…
Commit: 44b98d77ecda701902c6c39b4c6ab7a09cfcce9b
Parent: 1349b61bb72d3a42636053ede0d6fa71cd4f2d93
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Sep 18 13:29:17 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Sep 18 13:29:17 2019 -0500
tests: add test for pvscan activation of incomplete vg
---
test/shell/lvmetad-pvscan-cache-init.sh | 58 +++++++++++++++++++++++++++++++
1 files changed, 58 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvmetad-pvscan-cache-init.sh b/test/shell/lvmetad-pvscan-cache-init.sh
new file mode 100644
index 0000000..69fecf3
--- /dev/null
+++ b/test/shell/lvmetad-pvscan-cache-init.sh
@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2012 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+SKIP_WITH_LVMLOCKD=1
+SKIP_WITHOUT_LVMETAD=1
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+aux prepare_devs 2
+
+pvcreate "$dev1"
+pvcreate "$dev2"
+vgcreate $vg1 "$dev1" "$dev2"
+lvcreate -l1 -an -n $lv1 $vg1 "$dev1"
+lvcreate -l1 -an -n $lv2 $vg1 "$dev2"
+
+aux disable_dev "$dev2"
+
+kill "$(< LOCAL_LVMETAD)"
+for i in {200..0} ; do
+ test -e "$TESTDIR/lvmetad.socket" || break
+ test "$i" -eq 0 && die "Too slow closing of lvmetad.socket. Aborting test."
+ echo -n .; sleep .1;
+done # wait for the socket close
+test ! -e "$LVM_LVMETAD_PIDFILE"
+
+lvmetad
+
+while ! test -e "$TESTDIR/lvmetad.socket"; do echo -n .; sleep .1; done # wait for the socket
+
+test -e "$LVM_LVMETAD_PIDFILE"
+
+cp "$LVM_LVMETAD_PIDFILE" LOCAL_LVMETAD
+
+pvscan --cache -aay "$dev1"
+
+check lv_field $vg1/$lv1 lv_active ""
+check lv_field $vg1/$lv2 lv_active ""
+
+aux enable_dev "$dev2"
+
+pvscan --cache -aay "$dev2"
+
+check lv_field $vg1/$lv1 lv_active "active"
+check lv_field $vg1/$lv2 lv_active "active"
+
+vgchange -an $vg1
+vgremove -ff $vg1
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1349b61bb72d3a4263605…
Commit: 1349b61bb72d3a42636053ede0d6fa71cd4f2d93
Parent: 2e51535b18f3a05428f087f3916ebce5c08d58d1
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Sep 18 12:42:50 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Sep 18 12:46:22 2019 +0200
pvmove: check if participating LV is already exlcusively active
When running pvmove, we need to decide whether pvmove has to be doing
exlusive or non-exclusive activations for LV.
Whenever LV that requires exlusive activation is present, it makes
pvmove exlusive. But when there is already activate i.e. linear LV
in exclusive mode it also needs to switch pvmove into 'exlusively
activating' pvmove.
---
WHATS_NEW | 1 +
tools/pvmove.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index eee10ce..0a5bda3 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.187 -
===================================
+ Pvmove runs in exlusively activating mode for exclusively active LVs.
Activate thin-pool layered volume as 'read-only' device.
Ignore crypto devices with UUID signature CRYPT-SUBDEV.
Enhance validation for thin and cache pool conversion and swapping.
diff --git a/tools/pvmove.c b/tools/pvmove.c
index 754bd58..3a447c4 100644
--- a/tools/pvmove.c
+++ b/tools/pvmove.c
@@ -674,7 +674,8 @@ static int _pvmove_setup_single(struct cmd_context *cmd,
dm_list_iterate_items(lvl, lvs_changed) {
lvh = lv_lock_holder(lvl->lv);
/* Exclusive LV decides whether pvmove must be also exclusive */
- if (lv_is_origin(lvh) || seg_only_exclusive(first_seg(lvh)))
+ if (lv_is_origin(lvh) || seg_only_exclusive(first_seg(lvh)) ||
+ lv_is_active_exclusive(lvh))
exclusive = 1;
}
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2e51535b18f3a05428f08…
Commit: 2e51535b18f3a05428f087f3916ebce5c08d58d1
Parent: 2caae8a572f5d31f9dececf75aa4126be439bcba
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Sep 14 01:08:14 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 17 15:29:11 2019 +0200
thin: activate layer pool aas read-only LV
When lvm2 is activating layered pool LV (to basically keep pool opened,
the other function used to be 'locking' be in sync with DM table)
use this LV in read-only mode - this prevents 'write' access into
data volume content of thin-pool.
Note: since EMPTY/unused thin-pool is created as 'public LV' for generic
use by any user who i.e. wish to maintain thin-pool and thins himself.
At this moment, thin-pool appears as writable LV. As soon as the 1st.
thinLV is created, layer volume will appear is 'read-only' LV from this moment.
---
WHATS_NEW | 1 +
lib/activate/dev_manager.c | 5 +++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 32298c8..eee10ce 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.187 -
===================================
+ Activate thin-pool layered volume as 'read-only' device.
Ignore crypto devices with UUID signature CRYPT-SUBDEV.
Enhance validation for thin and cache pool conversion and swapping.
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 657b046..886e11b 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -85,6 +85,11 @@ int read_only_lv(const struct logical_volume *lv, const struct lv_activate_opts
if (lv_is_raid_image(lv) || lv_is_raid_metadata(lv))
return 0; /* Keep RAID SubLvs writable */
+ if (!layer) {
+ if (lv_is_thin_pool(lv))
+ return 1;
+ }
+
return (laopts->read_only || !(lv->status & LVM_WRITE));
}
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=66f69e766e576692ea323…
Commit: 66f69e766e576692ea32328c1921acbacb69ed14
Parent: 693215716bde963d03c1adbddc6ecd39a0ea256c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Sep 14 01:08:14 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 17 13:16:50 2019 +0200
thin: activate layer pool aas read-only LV
When lvm2 is activating layered pool LV (to basically keep pool opened,
the other function used to be 'locking' be in sync with DM table)
use this LV in read-only mode - this prevents 'write' access into
data volume content of thin-pool.
Note: since EMPTY/unused thin-pool is created as 'public LV' for generic
use by any user who i.e. wish to maintain thin-pool and thins himself.
At this moment, thin-pool appears as writable LV. As soon as the 1st.
thinLV is created, layer volume will appear is 'read-only' LV from this moment.
---
WHATS_NEW | 1 +
lib/activate/dev_manager.c | 5 +++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 37ce33b..81a73ef 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.03.06 -
================================
+ Activate thin-pool layered volume as 'read-only' device.
Ignore crypto devices with UUID signature CRYPT-SUBDEV.
Enhance validation for thin and cache pool conversion and swapping.
Improve internal removal of cached devices.
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index c780dea..32fdcb9 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -85,6 +85,11 @@ int read_only_lv(const struct logical_volume *lv, const struct lv_activate_opts
if (lv_is_raid_image(lv) || lv_is_raid_metadata(lv))
return 0; /* Keep RAID SubLvs writable */
+ if (!layer) {
+ if (lv_is_thin_pool(lv))
+ return 1;
+ }
+
return (laopts->read_only || !(lv->status & LVM_WRITE));
}