master - tests: updates test for raid scanning
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=59dc9b445d6dba0ae11...
Commit: 59dc9b445d6dba0ae119a2f517f4f665c6c522a9
Parent: f20e828ec2c6ef6fbd6a271ecbf904a8e7943958
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jun 5 18:45:08 2018 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 8 14:37:31 2018 +0200
tests: updates test for raid scanning
---
test/shell/pvcreate-md-fake-hdr.sh | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/test/shell/pvcreate-md-fake-hdr.sh b/test/shell/pvcreate-md-fake-hdr.sh
index b89fe43..13d810c 100644
--- a/test/shell/pvcreate-md-fake-hdr.sh
+++ b/test/shell/pvcreate-md-fake-hdr.sh
@@ -25,6 +25,12 @@ aux extend_filter_LVMTEST "a|/dev/md|"
aux prepare_devs 4
+pvcreate "$dev2"
+aux prepare_md_dev 0 64 2 "$dev1" "$dev2"
+# Incorrectly shows $dev2 as PV for 'raid0'
+pvs -vvvv
+
+
vgcreate $SHARED $vg "$dev3" "$dev4"
# create 2 disk MD raid1 array
5 years, 11 months
master - tests: drop unit subdir
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f20e828ec2c6ef6fbd6...
Commit: f20e828ec2c6ef6fbd6a271ecbf904a8e7943958
Parent: bb7c064b23c90e32ab4e8da610fca2c4e7bac73e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 8 12:37:57 2018 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 8 14:37:31 2018 +0200
tests: drop unit subdir
Until we resolve top-level making, drop inclusion of subdir Makefile
written for top-level usage so at least integrational tests are running.
---
test/Makefile.in | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/test/Makefile.in b/test/Makefile.in
index 2b115b4..65ba900 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -27,7 +27,8 @@ datarootdir = @datarootdir@
LVM_TEST_RESULTS ?= results
-SUBDIRS = api unit
+SUBDIRS = api
+# FIXME: resolve testing of: unit
SOURCES = lib/not.c lib/harness.c
CXXSOURCES = lib/runner.cpp
CXXFLAGS += $(EXTRA_EXEC_CFLAGS)
5 years, 11 months
master - tests: initial testing code for lvs while pvmove runs
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=bb7c064b23c90e32ab4...
Commit: bb7c064b23c90e32ab4e8da610fca2c4e7bac73e
Parent: c93e0932e8d3005d2b0f6e1e66f7fba72f3ac950
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 8 12:51:27 2018 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 8 14:37:31 2018 +0200
tests: initial testing code for lvs while pvmove runs
---
test/shell/pvmove-lvs.sh | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/test/shell/pvmove-lvs.sh b/test/shell/pvmove-lvs.sh
new file mode 100644
index 0000000..754f86a
--- /dev/null
+++ b/test/shell/pvmove-lvs.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2018 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
+
+test_description="ensure pvmove works with lvs"
+SKIP_WITH_LVMLOCKD=1
+
+. lib/inittest
+
+aux throttle_dm_mirror || skip
+
+aux prepare_vg 5 180
+
+lvcreate -aey -L30 -n $lv1 $vg "$dev1"
+lvextend -L+30 $vg/$lv1 "$dev2"
+lvextend -L+30 $vg/$lv1 "$dev1"
+lvextend -L+30 $vg/$lv1 "$dev2"
+lvextend -L+30 $vg/$lv1 "$dev1"
+
+pvmove -b "$dev1" "$dev5" 2>&1 | tee out
+
+#lvchange -an $vg/$lv1
+lvs -a $vg
+
+pvmove --abort
+
+lvremove -ff $vg
5 years, 11 months
master - tests: check proper support of fmt2 with cleaner policy
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c93e0932e8d3005d2b0...
Commit: c93e0932e8d3005d2b0f6e1e66f7fba72f3ac950
Parent: 8b111f28b0cf75951c18f1b7f100e5aa59d4f659
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 8 12:46:47 2018 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 8 14:37:31 2018 +0200
tests: check proper support of fmt2 with cleaner policy
---
test/shell/cache-metadata2.sh | 10 ++++++++++
test/shell/lvconvert-cache.sh | 5 +++++
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/test/shell/cache-metadata2.sh b/test/shell/cache-metadata2.sh
index 684ae67..57c6e23 100644
--- a/test/shell/cache-metadata2.sh
+++ b/test/shell/cache-metadata2.sh
@@ -51,6 +51,11 @@ lvs -a -o+cachemetadataformat $vg
lvremove -f $vg
+lvcreate --type cache-pool --cachepolicy cleaner --cachemetadataformat 1 -L1 $vg/cpool
+lvcreate -H -L10 -n $lv1 --cachepool $vg/cpool
+check lv_field $vg/$lv1 cachemetadataformat "1"
+lvremove -f $vg
+
if [ -z "$META2" ]; then
# for these test we need kernel with metadata2 support
@@ -78,6 +83,11 @@ lvconvert --config 'allocation/cache_metadata_format=1' -y -H --cachepool $vg/cp
check lv_field $vg/$lv1 cachemetadataformat "1"
lvremove -f $vg
+lvcreate --type cache-pool --cachepolicy cleaner -L1 $vg/cpool
+lvcreate -H -L10 -n $lv1 --cachepool $vg/cpool
+check lv_field $vg/$lv1 cachemetadataformat "2"
+lvremove -f $vg
+
fi
#lvs -a -o name,cachemetadataformat,kernelmetadataformat,chunksize,cachepolicy,cachemode $vg
diff --git a/test/shell/lvconvert-cache.sh b/test/shell/lvconvert-cache.sh
index c3742af..b2a2920 100644
--- a/test/shell/lvconvert-cache.sh
+++ b/test/shell/lvconvert-cache.sh
@@ -106,6 +106,11 @@ fail lvconvert --type cache --cachepool $vg/pool $vg/corigin
lvconvert --yes --cache --cachepool $vg/pool $vg/corigin
lvremove -ff $vg
+# Check we also support conversion that uses 'cleaner' cache policy
+lvcreate -n corigin -l 10 $vg
+lvcreate -n pool -l 10 $vg
+lvconvert --yes --cache --cachepool $vg/pool $vg/corigin --cachepolicy cleaner
+lvremove -ff $vg
#######################
# Invalid conversions #
5 years, 11 months
master - cleanup: updates message with dots
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8b111f28b0cf75951c1...
Commit: 8b111f28b0cf75951c18f1b7f100e5aa59d4f659
Parent: bc8c8d2f87a93a5f1c77a928e7400d31788fc6fd
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jun 5 18:47:03 2018 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 8 14:37:31 2018 +0200
cleanup: updates message with dots
---
tools/vgcfgrestore.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/vgcfgrestore.c b/tools/vgcfgrestore.c
index adcd45a..ec2c240 100644
--- a/tools/vgcfgrestore.c
+++ b/tools/vgcfgrestore.c
@@ -25,7 +25,7 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv)
if (argc == 1) {
vg_name = skip_dev_dir(cmd, argv[0], NULL);
if (!validate_name(vg_name)) {
- log_error("Volume group name \"%s\" is invalid", vg_name);
+ log_error("Volume group name \"%s\" is invalid.", vg_name);
return EINVALID_CMD_LINE;
}
} else if (!(arg_is_set(cmd, list_ARG) && arg_is_set(cmd, file_ARG))) {
@@ -64,12 +64,12 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv)
}
if (!lock_vol(cmd, vg_name, LCK_VG_WRITE, NULL)) {
- log_error("Unable to lock volume group %s", vg_name);
+ log_error("Unable to lock volume group %s.", vg_name);
return ECMD_FAILED;
}
if (!lock_vol(cmd, VG_ORPHANS, LCK_VG_WRITE, NULL)) {
- log_error("Unable to lock orphans");
+ log_error("Unable to lock orphans.");
unlock_vg(cmd, NULL, vg_name);
return ECMD_FAILED;
}
@@ -91,7 +91,7 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv)
}
ret = ECMD_PROCESSED;
- log_print_unless_silent("Restored volume group %s", vg_name);
+ log_print_unless_silent("Restored volume group %s.", vg_name);
unlock_vg(cmd, NULL, VG_ORPHANS);
unlock_vg(cmd, NULL, vg_name);
5 years, 11 months
master - build: drop exported symbols
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=bc8c8d2f87a93a5f1c7...
Commit: bc8c8d2f87a93a5f1c77a928e7400d31788fc6fd
Parent: 5cb4b2a42465f2430c98c8966adeacb0f6a26af3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jun 7 23:23:06 2018 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 8 14:37:31 2018 +0200
build: drop exported symbols
This libs are no longer possible to create,
drop maintanence of exported symbols.
---
lib/cache_segtype/.exported_symbols | 1 -
lib/mirror/.exported_symbols | 1 -
lib/raid/.exported_symbols | 1 -
lib/snapshot/.exported_symbols | 1 -
lib/thin/.exported_symbols | 1 -
5 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/lib/cache_segtype/.exported_symbols b/lib/cache_segtype/.exported_symbols
deleted file mode 100644
index 95cb3ff..0000000
--- a/lib/cache_segtype/.exported_symbols
+++ /dev/null
@@ -1 +0,0 @@
-init_cache_segtypes
diff --git a/lib/mirror/.exported_symbols b/lib/mirror/.exported_symbols
deleted file mode 100644
index 1c92c6a..0000000
--- a/lib/mirror/.exported_symbols
+++ /dev/null
@@ -1 +0,0 @@
-init_segtype
diff --git a/lib/raid/.exported_symbols b/lib/raid/.exported_symbols
deleted file mode 100644
index 0d012d6..0000000
--- a/lib/raid/.exported_symbols
+++ /dev/null
@@ -1 +0,0 @@
-init_multiple_segtypes
diff --git a/lib/snapshot/.exported_symbols b/lib/snapshot/.exported_symbols
deleted file mode 100644
index 1c92c6a..0000000
--- a/lib/snapshot/.exported_symbols
+++ /dev/null
@@ -1 +0,0 @@
-init_segtype
diff --git a/lib/thin/.exported_symbols b/lib/thin/.exported_symbols
deleted file mode 100644
index 1c92c6a..0000000
--- a/lib/thin/.exported_symbols
+++ /dev/null
@@ -1 +0,0 @@
-init_segtype
5 years, 11 months
master - cache: cleaner policy also uses fmt2
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5cb4b2a42465f2430c9...
Commit: 5cb4b2a42465f2430c98c8966adeacb0f6a26af3
Parent: 1f5f8382ae09e3ba95486903cf86b29641a0023d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 8 12:37:07 2018 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 8 14:37:29 2018 +0200
cache: cleaner policy also uses fmt2
Format 2 is also with cleaner policy.
---
WHATS_NEW | 1 +
lib/metadata/cache_manip.c | 5 +++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index a17902d..162b584 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 3.0.0
=============
+ Cache can uses metadata format 2 with cleaner policy.
Fix check if resized PV can also fit metadata area.
Avoid showing internal error in lvs output or pvmoved LVs.
Remove clvmd
diff --git a/lib/metadata/cache_manip.c b/lib/metadata/cache_manip.c
index fe91fee..c3bd2ec 100644
--- a/lib/metadata/cache_manip.c
+++ b/lib/metadata/cache_manip.c
@@ -843,12 +843,13 @@ int cache_set_metadata_format(struct lv_segment *seg, cache_metadata_format_t fo
/*
* If policy is unselected, but format 2 is selected, policy smq is enforced.
- * ATM no other then smq policy is allowed to select format 2.
+ * ATM no other then smq & cleaner policy is allowed to select format 2.
*/
if (!seg->policy_name) {
if (format == CACHE_METADATA_FORMAT_2)
seg->policy_name = "smq";
- } else if (strcmp(seg->policy_name, "smq")) {
+ } else if (strcmp(seg->policy_name, "smq") &&
+ strcmp(seg->policy_name, "cleaner")) {
seg->cache_metadata_format = CACHE_METADATA_FORMAT_1;
return 1;
}
5 years, 11 months
master - pvresize: update message
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1f5f8382ae09e3ba954...
Commit: 1f5f8382ae09e3ba95486903cf86b29641a0023d
Parent: fb171edd4520a91012eb6ce6652c241609f5f761
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jun 5 23:09:55 2018 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 8 14:36:59 2018 +0200
pvresize: update message
There is always at least PV header update even if the size
of PV remains same (so it's not really resized).
Try to make it a slightly less confusing.
---
tools/pvresize.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/pvresize.c b/tools/pvresize.c
index 8a65952..e951f11 100644
--- a/tools/pvresize.c
+++ b/tools/pvresize.c
@@ -96,7 +96,7 @@ int pvresize(struct cmd_context *cmd, int argc, char **argv)
ret = process_each_pv(cmd, argc, argv, NULL, 0, READ_FOR_UPDATE | READ_ALLOW_EXPORTED, handle, _pvresize_single);
- log_print_unless_silent("%d physical volume(s) resized / %d physical volume(s) "
+ log_print_unless_silent("%d physical volume(s) resized or updated / %d physical volume(s) "
"not resized", params.done, params.total - params.done);
out:
destroy_processing_handle(cmd, handle);
5 years, 11 months
master - pvresize: add missing return
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fb171edd4520a91012e...
Commit: fb171edd4520a91012eb6ce6652c241609f5f761
Parent: 0c62ae3f8920ebb53397b2a904aa2e3dd3e73bed
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jun 5 21:21:26 2018 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 8 14:36:56 2018 +0200
pvresize: add missing return
Log error path missed return 0.
Also fix some unneded bactraces (since log_error already shows
position).
---
WHATS_NEW | 1 +
lib/metadata/pv_manip.c | 5 +++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index a727a40..a17902d 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 3.0.0
=============
+ Fix check if resized PV can also fit metadata area.
Avoid showing internal error in lvs output or pvmoved LVs.
Remove clvmd
Remove lvmlib (api)
diff --git a/lib/metadata/pv_manip.c b/lib/metadata/pv_manip.c
index eaaa5e6..5fd80a2 100644
--- a/lib/metadata/pv_manip.c
+++ b/lib/metadata/pv_manip.c
@@ -566,6 +566,7 @@ static int _pv_resize(struct physical_volume *pv, struct volume_group *vg, uint6
log_error("Size must exceed physical extent start "
"of %" PRIu64 " sectors on PV %s.",
pv_pe_start(pv), pv_dev_name(pv));
+ return 0;
}
old_pe_count = pv->pe_count;
@@ -645,7 +646,7 @@ int pv_resize_single(struct cmd_context *cmd,
pv_name, display_size(cmd, new_size),
display_size(cmd, size)) == 'n') {
log_error("Physical Volume %s not resized.", pv_name);
- goto_out;
+ goto out;
}
} else if (new_size < size)
@@ -653,7 +654,7 @@ int pv_resize_single(struct cmd_context *cmd,
pv_name, display_size(cmd, new_size),
display_size(cmd, size)) == 'n') {
log_error("Physical Volume %s not resized.", pv_name);
- goto_out;
+ goto out;
}
if (new_size == size)
5 years, 11 months
master - pvmove: improve lvs
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=0c62ae3f8920ebb5339...
Commit: 0c62ae3f8920ebb53397b2a904aa2e3dd3e73bed
Parent: b67ef90438052d3e01f563cdd25e2268f4e02c20
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jun 4 11:05:28 2018 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 8 14:35:42 2018 +0200
pvmove: improve lvs
When pvmoving LV - the target for LV is a mirror so the validation
that checked the type is matching was incorrect.
While we need a more generic enhancment of LVS output for pvmoved LVs,
for now at least stop showing internal errors and 'X' symbols in attrs.
---
WHATS_NEW | 1 +
lib/activate/dev_manager.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index d75ab1b..a727a40 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 3.0.0
=============
+ Avoid showing internal error in lvs output or pvmoved LVs.
Remove clvmd
Remove lvmlib (api)
lvconvert: provide possible layouts between linear and striped/raid
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 5dd0e6f..2688bcf 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -178,7 +178,8 @@ static int _get_segment_status_from_target_params(const char *target_name,
}
/* Validate target_name segtype from DM table with lvm2 metadata segtype */
- if (strcmp(segtype->name, target_name) &&
+ if (!lv_is_locked(seg->lv) &&
+ strcmp(segtype->name, target_name) &&
/* If kernel's type isn't an exact match is it compatible? */
(!segtype->ops->target_status_compatible ||
!segtype->ops->target_status_compatible(target_name))) {
5 years, 11 months