master - tests: make test more race immune
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d757b2431a56bd...
Commit: d757b2431a56bd5ae45fe863423942d89e14cbf9
Parent: a4be2be5a441e3a85d50ce5728b9d1b82e7d1fc6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jan 6 21:46:58 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jan 6 23:39:53 2017 +0100
tests: make test more race immune
Add more delay and increase raid size.
Speedup volume during wait for sync.
Drop --yes from lvcreate.
---
test/shell/lvcreate-raid-nosync.sh | 49 ++++++++++++++++++-----------------
1 files changed, 25 insertions(+), 24 deletions(-)
diff --git a/test/shell/lvcreate-raid-nosync.sh b/test/shell/lvcreate-raid-nosync.sh
index b1916f5..40baa17 100644
--- a/test/shell/lvcreate-raid-nosync.sh
+++ b/test/shell/lvcreate-raid-nosync.sh
@@ -21,67 +21,68 @@ aux have_raid4 && segtypes="raid4 raid5"
aux prepare_vg 6
+_sync() {
+ aux enable_dev "$dev1"
+
+ aux wait_for_sync $vg $lv1
+ test -z "$1" || check raid_leg_status $vg $lv1 $1
+ lvremove --yes $vg/$lv1
+
+ # restore to delay_dev tables for all devices
+ aux restore_from_devtable "$dev1"
+}
+
# Delay 1st leg so that rebuilding status characters
# can be read before resync finished too quick.
-aux delay_dev "$dev1" 0 50 $(get first_extent_sector "$dev1")
+aux delay_dev "$dev1" 0 90 $(get first_extent_sector "$dev1")
# raid0/raid0_meta don't support resynchronization
for r in raid0 raid0_meta
do
- lvcreate --yes --type $r -i 3 -l 1 -n $lv1 $vg
+ lvcreate --type $r -i 3 -l 1 -n $lv1 $vg
check raid_leg_status $vg $lv1 "AAA"
lvremove --yes $vg/$lv1
done
# raid1 supports resynchronization
-lvcreate --yes --type raid1 -m 2 -l 2 -n $lv1 $vg
+lvcreate --type raid1 -m 2 -l 4 -n $lv1 $vg
check raid_leg_status $vg $lv1 "aaa"
-aux wait_for_sync $vg $lv1
-check raid_leg_status $vg $lv1 "AAA"
-lvremove --yes $vg/$lv1
+_sync "AAA"
# raid1 supports --nosync
-lvcreate --yes --type raid1 --nosync -m 2 -l 1 -n $lv1 $vg
+lvcreate --type raid1 --nosync -m 2 -l 1 -n $lv1 $vg
check raid_leg_status $vg $lv1 "AAA"
lvremove --yes $vg/$lv1
for r in $segtypes
do
# raid4/5 support resynchronization
- lvcreate --yes --type $r -i 3 -l 2 -n $lv1 $vg
+ lvcreate --type $r -i 3 -l 4 -n $lv1 $vg
check raid_leg_status $vg $lv1 "aaaa"
- aux wait_for_sync $vg $lv1
- check raid_leg_status $vg $lv1 "AAAA"
+ _sync "AAAA"
# raid4/5 support --nosync
- lvcreate --yes --type $r --nosync -i 3 -l 1 -n $lv2 $vg
+ lvcreate --type $r --nosync -i 3 -l 1 -n $lv2 $vg
check raid_leg_status $vg $lv2 "AAAA"
lvremove --yes $vg
done
# raid6 supports resynchronization
-lvcreate --yes --type raid6 -i 3 -l 2 -n $lv1 $vg
+lvcreate --type raid6 -i 3 -l 4 -n $lv1 $vg
check raid_leg_status $vg $lv1 "aaaaa"
-aux wait_for_sync $vg $lv1
-check raid_leg_status $vg $lv1 "AAAAA"
-lvremove --yes $vg/$lv1
+_sync "AAAAA"
# raid6 rejects --nosync; it has to initialize P- and Q-Syndromes
-not lvcreate --yes --type raid6 --nosync -i 3 -l 1 -n $lv1 $vg
+not lvcreate --type raid6 --nosync -i 3 -l 1 -n $lv1 $vg
# raid10 supports resynchronization
-lvcreate --yes --type raid10 -m 1 -i 3 -l 2 -n $lv1 $vg
+lvcreate --type raid10 -m 1 -i 3 -l 4 -n $lv1 $vg
check raid_leg_status $vg $lv1 "aaaaaa"
-aux wait_for_sync $vg $lv1
-check raid_leg_status $vg $lv1 "AAAAAA"
-aux wait_for_sync $vg $lv1
-lvremove --yes $vg/$lv1
+_sync "AAAAAA"
# raid10 supports --nosync
-lvcreate --yes --type raid10 --nosync -m 1 -i 3 -l 1 -n $lv1 $vg
+lvcreate --type raid10 --nosync -m 1 -i 3 -l 1 -n $lv1 $vg
check raid_leg_status $vg $lv1 "AAAAAA"
-aux wait_for_sync $vg $lv1
-lvremove --yes $vg/$lv1
vgremove -ff $vg
7 years, 3 months
master - raid: postpone archiving until metadata are changed
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a4be2be5a441e3...
Commit: a4be2be5a441e3a85d50ce5728b9d1b82e7d1fc6
Parent: 0d2a9ebec6b7555a09f26aa513b2a2f94fc19027
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jan 6 23:36:31 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jan 6 23:39:04 2017 +0100
raid: postpone archiving until metadata are changed
Avoid archiving of lvm2 metadata when there is call of 'lvconvert --repair'
on healthy raid LV.
---
lib/metadata/raid_manip.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index bceff79..8c88280 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -3952,9 +3952,6 @@ static int _lv_raid_rebuild_or_replace(struct logical_volume *lv,
return 0;
}
- if (!archive(lv->vg))
- return_0;
-
/*
* How many sub-LVs are being removed?
*/
@@ -3972,6 +3969,9 @@ static int _lv_raid_rebuild_or_replace(struct logical_volume *lv,
lv_is_on_pvs(seg_metalv(raid_seg, s), remove_pvs)) {
match_count++;
if (rebuild) {
+ if ((match_count == 1) &&
+ !archive(lv->vg))
+ return_0;
seg_lv(raid_seg, s)->status |= LV_REBUILD;
seg_metalv(raid_seg, s)->status |= LV_REBUILD;
}
@@ -4017,6 +4017,9 @@ static int _lv_raid_rebuild_or_replace(struct logical_volume *lv,
if (rebuild)
goto skip_alloc;
+ if (!archive(lv->vg))
+ return_0;
+
/* Prevent any PVs holding image components from being used for allocation */
if (!_avoid_pvs_with_other_images_of_lv(lv, allocate_pvs)) {
log_error("Failed to prevent PVs holding image components "
7 years, 3 months
master - vgchange: also -l is uint32
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0d2a9ebec6b755...
Commit: 0d2a9ebec6b7555a09f26aa513b2a2f94fc19027
Parent: 8a93cde75ef4a4b260d937c5924267d0eab31df3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jan 6 21:24:16 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jan 6 21:51:36 2017 +0100
vgchange: also -l is uint32
---
test/shell/vgchange-usage.sh | 5 +++++
tools/args.h | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/test/shell/vgchange-usage.sh b/test/shell/vgchange-usage.sh
index 08d8114..44e0fd9 100644
--- a/test/shell/vgchange-usage.sh
+++ b/test/shell/vgchange-usage.sh
@@ -63,6 +63,11 @@ check vg_field $vg max_pv 4294967295
# vgchange -l MaxLogicalVolumes
check vg_field $vg max_lv 0
invalid vgchange -l -128 $vg
+vgchange -l 4294967295 $vg
+invalid vgchange -l 4294967296 $vg
+invalid vgchange -l 18446744073709551615 $vg
+invalid vgchange -l 18446744073709551616 $vg
+check vg_field $vg max_lv 4294967295
vgchange -l 128 $vg
check vg_field $vg max_lv 128
diff --git a/tools/args.h b/tools/args.h
index d5f1186..a6fc77c 100644
--- a/tools/args.h
+++ b/tools/args.h
@@ -178,8 +178,8 @@ arg(interval_ARG, 'i', "interval", int_arg, 0, 0)
arg(iop_version_ARG, 'i', "iop_version", NULL, 0, 0)
arg(stripes_ARG, 'i', "stripes", int_arg, 0, 0)
arg(stripesize_ARG, 'I', "stripesize", size_kb_arg, 0, 0)
-arg(logicalvolume_ARG, 'l', "logicalvolume", int_arg, 0, 0)
-arg(maxlogicalvolumes_ARG, 'l', "maxlogicalvolumes", int_arg, 0, 0)
+arg(logicalvolume_ARG, 'l', "logicalvolume", uint32_arg, 0, 0)
+arg(maxlogicalvolumes_ARG, 'l', "maxlogicalvolumes", uint32_arg, 0, 0)
arg(extents_ARG, 'l', "extents", int_arg_with_sign_and_percent, 0, 0)
arg(list_ARG, 'l', "list", NULL, 0, 0)
arg(lvmpartition_ARG, 'l', "lvmpartition", NULL, 0, 0)
7 years, 3 months
master - mirror: relax internal error for a while
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8a93cde75ef4a4...
Commit: 8a93cde75ef4a4b260d937c5924267d0eab31df3
Parent: d90320f4f161658c6a004631c5685b40202af2cc
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jan 6 12:41:38 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jan 6 12:45:07 2017 +0100
mirror: relax internal error for a while
With recent commit d6a74025df1afb3d76bec435bc6a40d649217b42 using
INTERNAL_ERROR while cheking layer LV - it's been noticed mirror
logic currently doesn't do a correct thing during upconversion and
does a full-try instead of checking only allocator capabilities.
This leads to invalid usage of layer.
To keep existing code running before providing a fix, relax
INTERNAL_ERROR just an error and keep the 'code' running.
Once mirror code is fixed, these all check should be switched
to internal errors.
---
lib/metadata/lv_manip.c | 42 +++++++++++++++++++++++++++++++++++-------
1 files changed, 35 insertions(+), 7 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index ad400b2..3feec20 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -6533,13 +6533,41 @@ int remove_layer_from_lv(struct logical_volume *lv,
* Before removal, the layer should be cleaned up,
* i.e. additional segments and areas should have been removed.
*/
- if (dm_list_size(&parent_lv->segments) != 1 ||
- parent_seg->area_count != 1 ||
- seg_type(parent_seg, 0) != AREA_LV ||
- layer_lv != seg_lv(parent_seg, 0) ||
- parent_lv->le_count != layer_lv->le_count) {
- log_error(INTERNAL_ERROR "Inconsistent sizes of layer %s.",
- display_lvname(lv));
+ /* FIXME:
+ * These are all INTERNAL_ERROR, but ATM there is
+ * some internal API problem and this code is wrongle
+ * executed with certain mirror manipulations.
+ * So we need to fix mirror code first, then switch...
+ */
+ if (dm_list_size(&parent_lv->segments) != 1) {
+ log_error("Invalid %d segments in %s, expected only 1.",
+ dm_list_size(&parent_lv->segments),
+ display_lvname(parent_lv));
+ return 0;
+ }
+
+ if (parent_seg->area_count != 1) {
+ log_error("Invalid %d area count(s) in %s, expected only 1.",
+ parent_seg->area_count, display_lvname(parent_lv));
+ return 0;
+ }
+
+ if (seg_type(parent_seg, 0) != AREA_LV) {
+ log_error("Invalid seg_type %d in %s, expected LV.",
+ seg_type(parent_seg, 0), display_lvname(parent_lv));
+ return 0;
+ }
+
+ if (layer_lv != seg_lv(parent_seg, 0)) {
+ log_error("Layer doesn't match segment in %s.",
+ display_lvname(parent_lv));
+ return 0;
+ }
+
+ if (parent_lv->le_count != layer_lv->le_count) {
+ log_error("Inconsistent extent count (%u != %u) of layer %s.",
+ parent_lv->le_count, layer_lv->le_count,
+ display_lvname(parent_lv));
return 0;
}
7 years, 3 months
master - blkdeactivate: also unmount mount point on top of MD device if using blkdeactivate -u
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d90320f4f16165...
Commit: d90320f4f161658c6a004631c5685b40202af2cc
Parent: b92a9c3e1ab9972b059ef797136c7e04b4b9368f
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Jan 6 11:16:07 2017 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Jan 6 11:16:07 2017 +0100
blkdeactivate: also unmount mount point on top of MD device if using blkdeactivate -u
The blkdeactivate script processes MD devices too so we should unmount
any mount point on top of an MD device if blkdeactivate -u|--umount is
called.
Diagnosed and reported by: Rick Warner <rick(a)microway.com>
See also https://bugzilla.redhat.com/show_bug.cgi?id=1410585.
---
WHATS_NEW | 1 +
scripts/blkdeactivate.sh.in | 3 ++-
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 3fde645..44b1df8 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.169 -
=====================================
+ Also unmount mount point on top of MD device if using blkdeactivate -u.
Restore check preventing resize of cache type volumes (2.02.158).
Add missing udev sync when flushing dirty cache content.
vgchange -p accepts only uint32 numbers.
diff --git a/scripts/blkdeactivate.sh.in b/scripts/blkdeactivate.sh.in
index 443af9c..436c72e 100644
--- a/scripts/blkdeactivate.sh.in
+++ b/scripts/blkdeactivate.sh.in
@@ -171,7 +171,8 @@ device_umount_one() {
}
device_umount() {
- test "$devtype" != "lvm" && test "${kname:0:3}" != "dm-" && return 0
+ test "$devtype" != "lvm" && test "${kname:0:3}" != "dm-" \
+ && test "${kname:0:2}" != "md" && return 0
# FINDMNT is defined only if umount --all-targets is not available.
# In that case, read the list of multiple mount points of one device
7 years, 3 months
master - tests: slow down devs for raid more
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b92a9c3e1ab997...
Commit: b92a9c3e1ab9972b059ef797136c7e04b4b9368f
Parent: c64f4447d92c4c8bc72d33a9615ef62fcef41168
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jan 4 16:02:08 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jan 5 15:54:14 2017 +0100
tests: slow down devs for raid more
Since we still experience occasiaonal test failure - slow
things down even more to avoid race.
Add support for 'quick' table changes between normal & delayed tables.
---
test/lib/aux.sh | 25 +++++++++++++
test/shell/lvchange-rebuild-raid.sh | 68 ++++++++++++++++------------------
2 files changed, 57 insertions(+), 36 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 174e05e..027e3f4 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -975,6 +975,31 @@ enable_dev() {
done
}
+# Once there is $name.devtable
+# this is a quick way to restore to this table entry
+restore_from_devtable() {
+ local dev
+ local silent
+
+ if test "$1" = "--silent"; then
+ silent=1
+ shift
+ fi
+
+ rm -f debug.log strace.log
+ init_udev_transaction
+ for dev in "$@"; do
+ local name=$(echo "$dev" | sed -e 's,.*/,,')
+ dmsetup load "$name" "$name.devtable"
+ dmsetup resume "$name"
+ done
+ finish_udev_transaction
+
+ test -n "$silent" || for dev in "$@"; do
+ notify_lvmetad "$dev"
+ done
+}
+
#
# Convert device to device with errors
# Takes the list of pairs of error segment from:len
diff --git a/test/shell/lvchange-rebuild-raid.sh b/test/shell/lvchange-rebuild-raid.sh
index df6a8cb..c90406c 100644
--- a/test/shell/lvchange-rebuild-raid.sh
+++ b/test/shell/lvchange-rebuild-raid.sh
@@ -18,10 +18,20 @@ aux have_raid 1 3 2 || skip
aux prepare_vg 8
+_sync() {
+ aux enable_dev $(< DEVICES)
+
+ aux wait_for_sync $vg $lv1
+ test -z "$1" || check raid_leg_status $vg $lv1 $1
+
+ # restore to delay_dev tables for all devices
+ aux restore_from_devtable $(< DEVICES)
+}
+
# Delay legs so that rebuilding status characters can be read
for d in $(< DEVICES)
do
- aux delay_dev "$d" 0 20 $(get first_extent_sector "$d")
+ aux delay_dev "$d" 0 50 $(get first_extent_sector "$d")
done
# rhbz 1064592
@@ -30,115 +40,101 @@ done
# Create an 8-way striped raid10 with 4 mirror
# groups and rebuild selected PVs.
lvcreate --type raid10 -m 1 -i 4 -l 2 -n $lv1 $vg
-aux wait_for_sync $vg $lv1
+_sync
# Rebuild 1st and 2nd device would rebuild a
# whole mirror group and needs to be rejected.
not lvchange --yes --rebuild "$dev1" --rebuild "$dev2" $vg/$lv1
not check raid_leg_status $vg $lv1 "aAaAAAAA"
-aux wait_for_sync $vg $lv1
-check raid_leg_status $vg $lv1 "AAAAAAAA"
+_sync "AAAAAAAA"
# Rebuild 1st and 3rd device from different mirror groups is fine.
lvchange --yes --rebuild "$dev1" --rebuild "$dev3" $vg/$lv1
aux have_raid 1 9 && check raid_leg_status $vg $lv1 "aAaAAAAA"
-aux wait_for_sync $vg $lv1
-check raid_leg_status $vg $lv1 "AAAAAAAA"
+_sync "AAAAAAAA"
# Rebuild devices 1, 3, 6 from different mirror groups is fine.
lvchange --yes --rebuild "$dev1" --rebuild "$dev3" --rebuild "$dev6" $vg/$lv1
aux have_raid 1 9 && check raid_leg_status $vg $lv1 "aAaAAaAA"
-aux wait_for_sync $vg $lv1
-check raid_leg_status $vg $lv1 "AAAAAAAA"
+_sync "AAAAAAAA"
# Rebuild devices 1, 3, 5 and 6 with 5+6 being
# being a whole mirror group needs to be rejected.
not lvchange --yes --rebuild "$dev1" --rebuild "$dev3" --rebuild "$dev6" --rebuild "$dev5" $vg/$lv1
not check raid_leg_status $vg $lv1 "aAaAaaAA"
-aux wait_for_sync $vg $lv1
-check raid_leg_status $vg $lv1 "AAAAAAAA"
+_sync "AAAAAAAA"
# Rebuild devices 1, 3, 5 and 7 from different mirror groups is fine.
lvchange --yes --rebuild "$dev1" --rebuild "$dev3" --rebuild "$dev5" --rebuild "$dev7" $vg/$lv1
aux have_raid 1 9 && check raid_leg_status $vg $lv1 "aAaAaAaA"
-aux wait_for_sync $vg $lv1
+_sync
# Rebuild devices 2, 4, 6 and 8 from different mirror groups is fine.
lvchange --yes --rebuild "$dev2" --rebuild "$dev4" --rebuild "$dev6" --rebuild "$dev8" $vg/$lv1
aux have_raid 1 9 && check raid_leg_status $vg $lv1 "AaAaAaAa"
-aux wait_for_sync $vg $lv1
-check raid_leg_status $vg $lv1 "AAAAAAAA"
+_sync "AAAAAAAA"
##############################################
# Create an 8-legged raid1 and rebuild selected PVs
lvremove --yes $vg/$lv1
lvcreate --yes --type raid1 -m 7 -l 2 -n $lv1 $vg
-aux wait_for_sync $vg $lv1
-check raid_leg_status $vg $lv1 "AAAAAAAA"
+_sync "AAAAAAAA"
# Rebuilding all raid1 legs needs to be rejected.
not lvchange --yes --rebuild "$dev1" --rebuild "$dev2" --rebuild "$dev3" --rebuild "$dev4" \
--rebuild "$dev5" --rebuild "$dev6" --rebuild "$dev7" --rebuild "$dev8" $vg/$lv1
not check raid_leg_status $vg $lv1 "aaaaaaaa"
-aux wait_for_sync $vg $lv1
-check raid_leg_status $vg $lv1 "AAAAAAAA"
+_sync "AAAAAAAA"
# Rebuilding all but the raid1 master leg is fine.
lvchange --yes --rebuild "$dev2" --rebuild "$dev3" --rebuild "$dev4" \
--rebuild "$dev5" --rebuild "$dev6" --rebuild "$dev7" --rebuild "$dev8" $vg/$lv1
aux have_raid 1 9 && check raid_leg_status $vg $lv1 "Aaaaaaaa"
-aux wait_for_sync $vg $lv1
-check raid_leg_status $vg $lv1 "AAAAAAAA"
+_sync "AAAAAAAA"
# Rebuilding the raid1 master leg is fine.
lvchange --yes --rebuild "$dev1" $vg/$lv1
aux have_raid 1 9 && check raid_leg_status $vg $lv1 "aAAAAAAA"
-aux wait_for_sync $vg $lv1
-check raid_leg_status $vg $lv1 "AAAAAAAA"
+_sync "AAAAAAAA"
# Rebuild legs on devices 2, 4, 6 and 8 is fine.
lvchange --yes --rebuild "$dev2" --rebuild "$dev4" --rebuild "$dev6" --rebuild "$dev8" $vg/$lv1
aux have_raid 1 9 && check raid_leg_status $vg $lv1 "AaAaAaAa"
-aux wait_for_sync $vg $lv1
-check raid_leg_status $vg $lv1 "AAAAAAAA"
+_sync "AAAAAAAA"
##############################################
# Create an 6-legged raid6 and rebuild selected PVs
lvremove --yes $vg/$lv1
lvcreate --yes --type raid6 -i 4 -l 2 -n $lv1 $vg
-aux wait_for_sync $vg $lv1
-check raid_leg_status $vg $lv1 "AAAAAA"
+_sync "AAAAAA"
# Rebuilding all raid6 stripes needs to be rejected.
not lvchange --yes --rebuild "$dev1" --rebuild "$dev2" --rebuild "$dev3" \
--rebuild "$dev4" --rebuild "$dev5" --rebuild "$dev6" $vg/$lv1
not check raid_leg_status $vg $lv1 "aaaaaa"
-aux wait_for_sync $vg $lv1
-check raid_leg_status $vg $lv1 "AAAAAA"
+_sync "AAAAAA"
# Rebuilding more than 2 raid6 stripes needs to be rejected.
not lvchange --yes --rebuild "$dev2" --rebuild "$dev4" --rebuild "$dev6" $vg/$lv1
not check raid_leg_status $vg $lv1 "AaAaAa"
-aux wait_for_sync $vg $lv1
-check raid_leg_status $vg $lv1 "AAAAAA"
+_sync "AAAAAA"
# Rebuilding any 1 raid6 stripe is fine.
lvchange --yes --rebuild "$dev2" $vg/$lv1
aux have_raid 1 9 && check raid_leg_status $vg $lv1 "AaAAAA"
-aux wait_for_sync $vg $lv1
+_sync
+
lvchange --yes --rebuild "$dev5" $vg/$lv1
aux have_raid 1 9 && check raid_leg_status $vg $lv1 "AAAAaA"
-aux wait_for_sync $vg $lv1
-check raid_leg_status $vg $lv1 "AAAAAA"
+_sync "AAAAAA"
# Rebuilding any 2 raid6 stripes is fine.
lvchange --yes --rebuild "$dev2" --rebuild "$dev4" $vg/$lv1
aux have_raid 1 9 && check raid_leg_status $vg $lv1 "AaAaAA"
-aux wait_for_sync $vg $lv1
-check raid_leg_status $vg $lv1 "AAAAAA"
+_sync "AAAAAA"
+
lvchange --yes --rebuild "$dev1" --rebuild "$dev5" $vg/$lv1
aux have_raid 1 9 && check raid_leg_status $vg $lv1 "aAAAaA"
-aux wait_for_sync $vg $lv1
-check raid_leg_status $vg $lv1 "AAAAAA"
+_sync "AAAAAA"
vgremove -ff $vg
7 years, 3 months
master - tests: drop FIXME
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c64f4447d92c4c...
Commit: c64f4447d92c4c8bc72d33a9615ef62fcef41168
Parent: 74969c9a38c286037d499a6ed603b1ae806cd37b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jan 4 11:21:20 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jan 5 15:54:14 2017 +0100
tests: drop FIXME
Since we fixed core trouble with sequence of
suspend/resume/suspend without udev wait
we can drop 'should' and expect volume is still mounted.
---
test/shell/lvconvert-thin-external-cache.sh | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/test/shell/lvconvert-thin-external-cache.sh b/test/shell/lvconvert-thin-external-cache.sh
index dae65a0..c4d7d61 100644
--- a/test/shell/lvconvert-thin-external-cache.sh
+++ b/test/shell/lvconvert-thin-external-cache.sh
@@ -50,11 +50,8 @@ not lvconvert --thin --thinpool $vg/tpool $vg/$lv1
# Switch to 'writethrough' - this should be supported
lvchange --cachemode writethrough $vg/$lv1
-# FIXME
-# systemd on fc23 'strikes-in' and unmounts mnt
-# ATM the reason is unclear (bug in systemd, bad udev rules?)
-# as a workaround mount again and 'WARN' test
-should not mount "$DM_DEV_DIR/$vg/$lv1" mnt
+# Check $lv1 remains mounted (so it's not been unmounted by systemd)
+not mount "$DM_DEV_DIR/$vg/$lv1" mnt
lvconvert --thin $vg/$lv1 --originname extorg --thinpool $vg/tpool
7 years, 3 months
master - report: report merged state for inactive LV
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=74969c9a38c286...
Commit: 74969c9a38c286037d499a6ed603b1ae806cd37b
Parent: d6a74025df1afb3d76bec435bc6a40d649217b42
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jan 5 15:52:00 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jan 5 15:54:14 2017 +0100
report: report merged state for inactive LV
This was missing piece in 77997c7673bfca56f51ae4eb55a50bc76e40fe79.
When merging origin is inactive (while driver is loaded) we
could already report merge in progress values as there is
no way to activate 'old state' now.
---
tools/reporter.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/tools/reporter.c b/tools/reporter.c
index 6c5996b..e70fa29 100644
--- a/tools/reporter.c
+++ b/tools/reporter.c
@@ -136,11 +136,14 @@ static int _check_merging_origin(const struct logical_volume *lv,
case SEG_STATUS_SNAPSHOT:
break;
default:
+ /* When inactive, it's technically merging */
+ if (status->info_ok && !status->info.exists)
+ break;
return 1;
}
/* Origin is gone */
- log_debug_activation("Merge is progress, reporting merged LV %s.",
+ log_debug_activation("Merge is in progress, reporting merged LV %s.",
display_lvname(lv->snapshot->lv));
*merged = 1;
7 years, 3 months
master - debug: show proper error message for layer mismatch
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d6a74025df1afb...
Commit: d6a74025df1afb3d76bec435bc6a40d649217b42
Parent: 3e9c03cbbcf102029d11f312e1cd1d20284b6d03
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jan 5 15:49:07 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jan 5 15:54:14 2017 +0100
debug: show proper error message for layer mismatch
Show proper internal error for failing command when there are some
inconsitencies in sizes of LV and its layer instead of rather
meaningless error code 5.
(Could be hit i.e. if user tried to 'resize' cached LV and then
uncache such LV.)
---
lib/metadata/lv_manip.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index a954bf7..ad400b2 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -6537,8 +6537,11 @@ int remove_layer_from_lv(struct logical_volume *lv,
parent_seg->area_count != 1 ||
seg_type(parent_seg, 0) != AREA_LV ||
layer_lv != seg_lv(parent_seg, 0) ||
- parent_lv->le_count != layer_lv->le_count)
- return_0;
+ parent_lv->le_count != layer_lv->le_count) {
+ log_error(INTERNAL_ERROR "Inconsistent sizes of layer %s.",
+ display_lvname(lv));
+ return 0;
+ }
if (!lv_empty(parent_lv))
return_0;
7 years, 3 months
master - cache: resize is still unsupported
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3e9c03cbbcf102...
Commit: 3e9c03cbbcf102029d11f312e1cd1d20284b6d03
Parent: 1f5dde38a7ec18d86c38c0b7e1cb2a953ea5cf44
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jan 5 15:32:25 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jan 5 15:34:22 2017 +0100
cache: resize is still unsupported
During rework of resize code this validation check
has been lost (in my resize branch). Upstream
is still not supporting resize of any cache type LV
so needs to be prevented.
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 5 +++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 5fb5904..3fde645 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.169 -
=====================================
+ Restore check preventing resize of cache type volumes (2.02.158).
Add missing udev sync when flushing dirty cache content.
vgchange -p accepts only uint32 numbers.
Report thin LV date for merged LV when the merge is in progress.
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 9759cda..a954bf7 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -4687,6 +4687,11 @@ static int _lvresize_check(struct logical_volume *lv,
return 0;
}
+ if (lv_is_cache_type(lv)) {
+ log_error("Unable to resize logical volumes of cache type.");
+ return 0;
+ }
+
if (!lv_is_visible(lv) &&
!lv_is_thin_pool_metadata(lv) &&
!lv_is_lockd_sanlock_lv(lv)) {
7 years, 3 months