stable-2.02 - spec: Move blkdeactivate to device-mapper
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=6cad4eba9b8d59cfc78...
Commit: 6cad4eba9b8d59cfc78dcaab2fa13de1889367c6
Parent: 44b98d77ecda701902c6c39b4c6ab7a09cfcce9b
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Fri Sep 20 10:55:29 2019 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Fri Sep 20 10:56:46 2019 +0200
spec: Move blkdeactivate to device-mapper
---
spec/packages.inc | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/spec/packages.inc b/spec/packages.inc
index f7a9232..7330a5f 100644
--- a/spec/packages.inc
+++ b/spec/packages.inc
@@ -42,7 +42,6 @@ fi
%defattr(-,root,root,-)
%doc COPYING COPYING.LIB INSTALL README VERSION WHATS_NEW
%doc doc/lvm_fault_handling.txt
-%{_sbindir}/blkdeactivate
%{_sbindir}/fsadm
%{_sbindir}/lvchange
%{_sbindir}/lvconvert
@@ -100,7 +99,6 @@ fi
%{_mandir}/man7/lvmsystemid.7.gz
%{_mandir}/man7/lvmreport.7.gz
%{_mandir}/man7/lvmraid.7.gz
-%{_mandir}/man8/blkdeactivate.8.gz
%{_mandir}/man8/fsadm.8.gz
%{_mandir}/man8/lvchange.8.gz
%{_mandir}/man8/lvconvert.8.gz
@@ -537,8 +535,10 @@ for the kernel device-mapper.
%files -n device-mapper
%defattr(-,root,root,-)
%doc COPYING COPYING.LIB WHATS_NEW_DM VERSION_DM README INSTALL
+%{_sbindir}/blkdeactivate
%attr(755,root,root) %{_sbindir}/dmsetup
%{_sbindir}/dmstats
+%{_mandir}/man8/blkdeactivate.8.gz
%{_mandir}/man8/dmsetup.8.gz
%{_mandir}/man8/dmstats.8.gz
%if %{enable_dmfilemapd}
4 years, 6 months
stable-2.02 - tests: add test for pvscan activation of incomplete vg
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=44b98d77ecda701902c...
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
4 years, 6 months
stable-2.02 - pvmove: check if participating LV is already exlcusively active
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1349b61bb72d3a42636...
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;
}
4 years, 6 months
stable-2.02 - thin: activate layer pool aas read-only LV
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2e51535b18f3a05428f...
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));
}
4 years, 6 months
stable-2.02 - devices: crypto skip
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2caae8a572f5d31f9de...
Commit: 2caae8a572f5d31f9dececf75aa4126be439bcba
Parent: 2694f93bb4b670d5afc51ff656f51e1e2945664a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Sep 13 13:22:07 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 17 15:29:11 2019 +0200
devices: crypto skip
Devices with UUID signature CRYPT-SUBDEV are internal crypto devices.
---
WHATS_NEW | 1 +
lib/activate/dev_manager.c | 2 ++
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 8a597ba..32298c8 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.187 -
===================================
+ Ignore crypto devices with UUID signature CRYPT-SUBDEV.
Enhance validation for thin and cache pool conversion and swapping.
Version 2.02.186 - 27th August 2019
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index dc64159..657b046 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -33,6 +33,7 @@
#define MAX_TARGET_PARAMSIZE 50000
#define LVM_UDEV_NOSCAN_FLAG DM_SUBSYSTEM_UDEV_FLAG0
#define CRYPT_TEMP "CRYPT-TEMP"
+#define CRYPT_SUBDEV "CRYPT-SUBDEV"
#define STRATIS "stratis-"
typedef enum {
@@ -646,6 +647,7 @@ 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, CRYPT_SUBDEV, sizeof(CRYPT_SUBDEV) - 1) ||
!strncmp(uuid, STRATIS, sizeof(STRATIS) - 1))) {
/* Skip private crypto devices */
log_debug_activation("%s: Reserved uuid %s on %s device %s not usable.",
4 years, 6 months
master - vdo: enhance activation with layer -vpool
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=6612d8dd5e77eab1b24...
Commit: 6612d8dd5e77eab1b24cafccffa83e65a504c94f
Parent: 66f69e766e576692ea32328c1921acbacb69ed14
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Sep 14 01:13:33 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 17 13:17:19 2019 +0200
vdo: enhance activation with layer -vpool
Enhance 'activation' experience for VDO pool to more closely match
what happens for thin-pools where we do use a 'fake' LV to keep pool
running even when no thinLVs are active. This gives user a choice
whether he want to keep thin-pool running (wihout possibly lenghty
activation/deactivation process)
As we do plan to support multple VDO LVs to be mapped into a single VDO,
we want to give user same experience and 'use-patter' as with thin-pools.
This patch gives option to activate VDO pool only without activating
VDO LV.
Also due to 'fake' layering LV we can protect usage of VDO pool from
command like 'mkfs' which do require exlusive access to the volume,
which is no longer possible.
Note: VDO pool contains 1024 initial sectors as 'empty' header - such
header is also exposed in layered LV (as read-only LV).
For blkid we are indentified as LV with UUID suffix - thus private DM
device of lvm2 - so we do not need to store any extra info in this
header space (aka zero is good enough).
---
WHATS_NEW | 1 +
lib/activate/activate.c | 14 +++++++++++++-
lib/activate/dev_manager.c | 35 +++++++++++++++++++++++++++++------
lib/metadata/vdo_manip.c | 2 +-
lib/misc/lvm-string.c | 2 +-
tools/lvchange.c | 3 ---
6 files changed, 45 insertions(+), 12 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 81a73ef..a9bd750 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.03.06 -
================================
+ Allow standalone activation of VDO pool just like for thin-pools.
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/activate.c b/lib/activate/activate.c
index 38e21be..29cd2d3 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -794,6 +794,18 @@ int lv_info_with_seg_status(struct cmd_context *cmd,
return 1;
}
+ if (lv_is_vdo_pool(lv)) {
+ /* Always collect status for '-vpool' */
+ if (_lv_info(cmd, lv, 1, &status->info, lv_seg, &status->seg_status, 0, 0) &&
+ (status->seg_status.type == SEG_STATUS_VDO_POOL)) {
+ /* There is -tpool device, but query 'active' state of 'fake' vdo-pool */
+ if (!_lv_info(cmd, lv, 0, NULL, NULL, NULL, 0, 0))
+ status->info.exists = 0; /* So VDO pool LV is not active */
+ }
+
+ return 1;
+ }
+
return _lv_info(cmd, lv, 0, &status->info, lv_seg, &status->seg_status,
with_open_count, with_read_ahead);
}
@@ -1342,7 +1354,7 @@ int lv_vdo_pool_status(const struct logical_volume *lv, int flush,
int r = 0;
struct dev_manager *dm;
- if (!lv_info(lv->vg->cmd, lv, 0, NULL, 0, 0))
+ if (!lv_info(lv->vg->cmd, lv, 1, NULL, 0, 0))
return 0;
log_debug_activation("Checking VDO pool status for LV %s.",
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 32fdcb9..5ee5efe 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -1991,7 +1991,7 @@ static uint16_t _get_udev_flags(struct dev_manager *dm, const struct logical_vol
/* New thin-pool is regular LV with -tpool UUID suffix. */
udev_flags |= DM_UDEV_DISABLE_DISK_RULES_FLAG |
DM_UDEV_DISABLE_OTHER_RULES_FLAG;
- else if (layer || !lv_is_visible(lv) || lv_is_thin_pool(lv))
+ else if (layer || !lv_is_visible(lv) || lv_is_thin_pool(lv) || lv_is_vdo_pool(lv))
udev_flags |= DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG |
DM_UDEV_DISABLE_DISK_RULES_FLAG |
DM_UDEV_DISABLE_OTHER_RULES_FLAG;
@@ -2611,6 +2611,15 @@ static int _add_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
}
}
+ if (lv_is_vdo_pool(lv)) {
+ /*
+ * For both origin_only and !origin_only
+ * skips test for -vpool-real and vpool-cow
+ */
+ if (!_add_dev_to_dtree(dm, dtree, lv, lv_layer(lv)))
+ return_0;
+ }
+
if (lv_is_cache(lv)) {
if (!origin_only && !dm->activation && !dm->track_pending_delete) {
/* Setup callback for non-activation partial tree */
@@ -2682,7 +2691,8 @@ static int _add_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
if (seg_type(seg, s) == AREA_LV && seg_lv(seg, s) &&
/* origin only for cache without pending delete */
(!dm->track_pending_delete || !lv_is_cache(lv)) &&
- !_add_lv_to_dtree(dm, dtree, seg_lv(seg, s), 0))
+ !_add_lv_to_dtree(dm, dtree, seg_lv(seg, s),
+ lv_is_vdo_pool(seg_lv(seg, s)) ? 1 : 0))
return_0;
if (seg_is_raid_with_meta(seg) && seg->meta_areas && seg_metalv(seg, s) &&
!_add_lv_to_dtree(dm, dtree, seg_metalv(seg, s), 0))
@@ -2908,8 +2918,11 @@ static int _add_layer_target_to_dtree(struct dev_manager *dm,
if (!(layer_dlid = build_dm_uuid(dm->mem, lv, lv_layer(lv))))
return_0;
+
/* Add linear mapping over layered LV */
- if (!add_linear_area_to_dtree(dnode, lv->size, lv->vg->extent_size,
+ /* From VDO layer expose ONLY vdo pool header, we would need to use virtual size otherwise */
+ if (!add_linear_area_to_dtree(dnode, lv_is_vdo_pool(lv) ? first_seg(lv)->vdo_pool_header_size : lv->size,
+ lv->vg->extent_size,
lv->vg->cmd->use_linear_target,
lv->vg->name, lv->name) ||
!dm_tree_node_add_target_area(dnode, NULL, layer_dlid, 0))
@@ -3132,7 +3145,9 @@ static int _add_segment_to_dtree(struct dev_manager *dm,
/* origin only for cache without pending delete */
(!dm->track_pending_delete || !seg_is_cache(seg)) &&
!_add_new_lv_to_dtree(dm, dtree, seg_lv(seg, s),
- laopts, NULL))
+ laopts,
+ lv_is_vdo_pool(seg_lv(seg, s)) ?
+ lv_layer(seg_lv(seg, s)) : NULL))
return_0;
if (seg_is_raid_with_meta(seg) && seg->meta_areas && seg_metalv(seg, s) &&
!lv_is_raid_image_with_tracking(seg_lv(seg, s)) &&
@@ -3424,8 +3439,9 @@ static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
if (!_add_snapshot_target_to_dtree(dm, dnode, lv, laopts))
return_0;
} else if (!layer && ((lv_is_thin_pool(lv) && !lv_is_new_thin_pool(lv)) ||
+ lv_is_vdo_pool(lv) ||
lv_is_external_origin(lv))) {
- /* External origin or 'used' Thin pool is using layer */
+ /* External origin or 'used' Thin pool or VDO pool is using layer */
if (!_add_new_lv_to_dtree(dm, dtree, lv, laopts, lv_layer(lv)))
return_0;
if (!_add_layer_target_to_dtree(dm, dnode, lv))
@@ -3438,6 +3454,10 @@ static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
if (max_stripe_size < seg->stripe_size * seg->area_count)
max_stripe_size = seg->stripe_size * seg->area_count;
}
+
+ if (!layer && lv_is_vdo_pool(lv) &&
+ !_add_layer_target_to_dtree(dm, dnode, lv))
+ return_0;
}
/* Setup thin pool callback */
@@ -3705,7 +3725,10 @@ static int _tree_action(struct dev_manager *dm, const struct logical_volume *lv,
/* Add all required new devices to tree */
if (!_add_new_lv_to_dtree(dm, dtree, lv, laopts,
(lv_is_origin(lv) && laopts->origin_only) ? "real" :
- (lv_is_thin_pool(lv) && laopts->origin_only) ? "tpool" : NULL))
+ (laopts->origin_only &&
+ (lv_is_thin_pool(lv) ||
+ lv_is_vdo_pool(lv))) ?
+ lv_layer(lv) : NULL))
goto_out;
/* Preload any devices required before any suspensions */
diff --git a/lib/metadata/vdo_manip.c b/lib/metadata/vdo_manip.c
index 4be9d2b..548b4ad 100644
--- a/lib/metadata/vdo_manip.c
+++ b/lib/metadata/vdo_manip.c
@@ -159,7 +159,7 @@ int parse_vdo_pool_status(struct dm_pool *mem, const struct logical_volume *vdo_
status->data_usage = DM_PERCENT_INVALID;
if (!(dm_name = dm_build_dm_name(mem, vdo_pool_lv->vg->name,
- vdo_pool_lv->name, NULL))) {
+ vdo_pool_lv->name, lv_layer(vdo_pool_lv)))) {
log_error("Failed to build VDO DM name %s.",
display_lvname(vdo_pool_lv));
return 0;
diff --git a/lib/misc/lvm-string.c b/lib/misc/lvm-string.c
index 901243c..fe24f23 100644
--- a/lib/misc/lvm-string.c
+++ b/lib/misc/lvm-string.c
@@ -259,7 +259,7 @@ char *build_dm_uuid(struct dm_pool *mem, const struct logical_volume *lv,
lv_is_thin_pool(lv) ? "pool" :
lv_is_thin_pool_data(lv) ? "tdata" :
lv_is_thin_pool_metadata(lv) ? "tmeta" :
- lv_is_vdo_pool(lv) ? "vpool" :
+ lv_is_vdo_pool(lv) ? "pool" :
lv_is_vdo_pool_data(lv) ? "vdata" :
NULL;
}
diff --git a/tools/lvchange.c b/tools/lvchange.c
index c28a7bb..03a7793 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -1400,9 +1400,6 @@ static int _lvchange_activate_check(struct cmd_context *cmd,
return 0;
}
- if (lv_is_vdo_pool(lv) && !lv_is_named_arg)
- return 0; /* Skip VDO pool processing unless explicitely named */
-
return 1;
}
4 years, 6 months
master - tests: check vdo
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=38a3da532f27a8ccda6...
Commit: 38a3da532f27a8ccda652842bb89dbecb1e4a3f9
Parent: 6612d8dd5e77eab1b24cafccffa83e65a504c94f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Sep 14 09:50:18 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 17 13:17:21 2019 +0200
tests: check vdo
---
test/shell/lvchange-vdo.sh | 31 +++++++++++++++++++++++++------
1 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/test/shell/lvchange-vdo.sh b/test/shell/lvchange-vdo.sh
index 6d2b451..461b782 100644
--- a/test/shell/lvchange-vdo.sh
+++ b/test/shell/lvchange-vdo.sh
@@ -27,26 +27,26 @@ lvcreate --vdo -L5G -n $lv1 $vg/vdopool
# Wait till index gets openned
for i in {1..10} ; do
sleep .1
- check grep_dmsetup status $vg-vdopool " online online " || continue
+ check grep_dmsetup status $vg-vdopool-vpool " online online " || continue
break
done
# compression_ARG
lvchange --compression n $vg/vdopool
-check grep_dmsetup status $vg-vdopool " online offline "
+check grep_dmsetup status $vg-vdopool-vpool " online offline "
lvchange --compression y $vg/vdopool
-check grep_dmsetup status $vg-vdopool " online online "
+check grep_dmsetup status $vg-vdopool-vpool " online online "
# dedulication_ARG
lvchange --deduplication n $vg/vdopool
-check grep_dmsetup status $vg-vdopool " offline online "
+check grep_dmsetup status $vg-vdopool-vpool " offline online "
lvchange --deduplication y $vg/vdopool
-check grep_dmsetup status $vg-vdopool " online online "
+check grep_dmsetup status $vg-vdopool-vpool " online online "
lvchange --compression n --deduplication n $vg/vdopool
-check grep_dmsetup status $vg-vdopool " offline offline "
+check grep_dmsetup status $vg-vdopool-vpool " offline offline "
lvchange -an $vg/$lv1
@@ -117,6 +117,25 @@ not lvchange --zero y $vg/$lv1
not lvchange --resync -ay $vg/$lv1
not lvchange --resync --addtag foo $vg/$lv1
+# Check activation of VDO alone works (like for thin-pools)
+lvchange -an $vg
+
+lvchange -ay $vg/vdopool
+check active $vg vdopool
+check inactive $vg $lv1
+
+lvchange -ay $vg/$lv1
+check active $vg $lv1
+
+lvchange -an $vg/$lv1
+check active $vg vdopool
+check inactive $vg $lv1
+
+lvchange -ay $vg/$lv1
+lvchange -an $vg/vdopool
+lvchange -an $vg/$lv1
+check inactive $vg vdopool
+
#
# Play with tags and activation
#
4 years, 6 months
master - thin: activate layer pool aas read-only LV
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=66f69e766e576692ea3...
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));
}
4 years, 6 months
master - devices: crypto skip
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=693215716bde963d03c...
Commit: 693215716bde963d03c1adbddc6ecd39a0ea256c
Parent: ee6b9b78ece389813895e3ecf79e5bbcbafee871
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Sep 13 13:22:07 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 17 13:15:22 2019 +0200
devices: crypto skip
Devices with UUID signature CRYPT-SUBDEV are internal crypto devices.
---
WHATS_NEW | 1 +
lib/activate/dev_manager.c | 2 ++
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 518b944..37ce33b 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.03.06 -
================================
+ Ignore crypto devices with UUID signature CRYPT-SUBDEV.
Enhance validation for thin and cache pool conversion and swapping.
Improve internal removal of cached devices.
Synchronize with udev when dropping snapshot.
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 3a6f11f..c780dea 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -33,6 +33,7 @@
#define MAX_TARGET_PARAMSIZE 50000
#define LVM_UDEV_NOSCAN_FLAG DM_SUBSYSTEM_UDEV_FLAG0
#define CRYPT_TEMP "CRYPT-TEMP"
+#define CRYPT_SUBDEV "CRYPT-SUBDEV"
#define STRATIS "stratis-"
typedef enum {
@@ -658,6 +659,7 @@ 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, CRYPT_SUBDEV, sizeof(CRYPT_SUBDEV) - 1) ||
!strncmp(uuid, STRATIS, sizeof(STRATIS) - 1))) {
/* Skip private crypto devices */
log_debug_activation("%s: Reserved uuid %s on %s device %s not usable.",
4 years, 6 months
master - tests: pool conversion
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ee6b9b78ece38981389...
Commit: ee6b9b78ece389813895e3ecf79e5bbcbafee871
Parent: 7612c21f5511c58bac81fc46e304bd9f4cd2cd75
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Sep 17 11:27:13 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 17 13:13:49 2019 +0200
tests: pool conversion
Test conversion of cached LV.
---
test/shell/lvconvert-cache-thin.sh | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvconvert-cache-thin.sh b/test/shell/lvconvert-cache-thin.sh
index e1d38b8..7dda6e6 100644
--- a/test/shell/lvconvert-cache-thin.sh
+++ b/test/shell/lvconvert-cache-thin.sh
@@ -51,4 +51,20 @@ check lv_field $vg/$lv1 segtype "thin"
lvconvert --uncache $vg/tpool
lvs -a $vg
+lvremove -f $vg
+
+# Check conversion of cached LV works as thin-pool
+lvcreate -L10 -n $lv $vg
+lvcreate -L10 -n $lv1 $vg
+lvcreate -H -L10 $vg/$lv
+
+# Stack of cache over cache is unsupported ATM
+fail lvconvert --yes --cachepool $vg/$lv
+
+# Thin-pool cannot use cached metaddata LV (meta should be on FAST device)
+fail lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $vg/$lv
+
+# Thin-pool CAN use cached data LV
+lvconvert --yes --thinpool $vg/$lv
+
vgremove -f $vg
4 years, 6 months