master - tests: put "" around dev path
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a5b34f0f1bf388...
Commit: a5b34f0f1bf38807bdbed2855516f9b2ceebf7b7
Parent: 4459413225eaa10278bd47fc33e30b85794ad7f6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Apr 8 22:43:52 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Apr 8 23:19:37 2015 +0200
tests: put "" around dev path
---
test/lib/aux.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index cc102fe..3232074 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -513,8 +513,8 @@ disable_dev() {
echo "Disabling device $dev ($maj:$min)"
notify="$notify $maj:$min"
if test -n "$error"; then
- echo 0 10000000 error | dmsetup load $dev
- dmsetup resume $dev
+ echo 0 10000000 error | dmsetup load "$dev"
+ dmsetup resume "$dev"
else
dmsetup remove -f "$dev" 2>/dev/null || true
fi
7 years, 11 months
master - clvmd: singlenode signals only when lock changes
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4459413225eaa1...
Commit: 4459413225eaa10278bd47fc33e30b85794ad7f6
Parent: f32973c78e981226577e88db662a285ea6c11bd5
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Apr 8 23:12:29 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Apr 8 23:19:34 2015 +0200
clvmd: singlenode signals only when lock changes
There is no benefit in waking-up all the waiters
when there is no actual change in lock state.
This avoid some unnecessarily ping-pong effects like:
Resource V_LVMTEST15724vg retrying lock in mode:WRITE...
Resource V_LVMTEST15724vg already locked lockid=40, mode:WRITE
Resource V_LVMTEST15724vg retrying lock in mode:WRITE...
Resource V_LVMTEST15724vg already locked lockid=40, mode:WRITE
---
WHATS_NEW | 1 +
daemons/clvmd/clvmd-singlenode.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 79136f9..6f43437 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.119 -
==================================
+ More efficient clvmd singlenode locking emulation.
Don't skip invalidation of cached orphans if vg write lck is held (2.02.118).
Log relevant PV tags when using cling allocation.
Add str_list_add_list() to combine two lists.
diff --git a/daemons/clvmd/clvmd-singlenode.c b/daemons/clvmd/clvmd-singlenode.c
index e6d2b0d..dc9360d 100644
--- a/daemons/clvmd/clvmd-singlenode.c
+++ b/daemons/clvmd/clvmd-singlenode.c
@@ -208,8 +208,6 @@ static int _lock_resource(const char *resource, int mode, int flags, int *lockid
pthread_mutex_lock(&_lock_mutex);
retry:
- pthread_cond_broadcast(&_lock_cond); /* to wakeup waiters */
-
if (!(head = dm_hash_lookup(_locks, resource))) {
if (flags & LCKF_CONVERT) {
/* In real DLM, lock is identified only by lockid, resource is not used */
@@ -269,12 +267,14 @@ retry:
dm_list_add(head, &lck->list);
}
out:
+ pthread_cond_broadcast(&_lock_cond); /* to wakeup waiters */
pthread_mutex_unlock(&_lock_mutex);
DEBUGLOG("Locked resource %s, lockid=%d, mode=%s\n",
resource, lck->lockid, _get_mode(lck->mode));
return 0;
bad:
+ pthread_cond_broadcast(&_lock_cond); /* to wakeup waiters */
pthread_mutex_unlock(&_lock_mutex);
DEBUGLOG("Failed to lock resource %s\n", resource);
7 years, 11 months
master - select: mention { } use in lvm.8 man page and '-S help' properly
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f32973c78e9812...
Commit: f32973c78e981226577e88db662a285ea6c11bd5
Parent: 8fdca0de7910052594a55bfb7bd3815afe701dad
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Apr 8 11:14:16 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Apr 8 11:14:16 2015 +0200
select: mention { } use in lvm.8 man page and '-S help' properly
---
libdm/libdm-report.c | 2 +-
man/lvm.8.in | 10 +++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c
index 6f528f1..9f50ff3 100644
--- a/libdm/libdm-report.c
+++ b/libdm/libdm-report.c
@@ -2612,7 +2612,7 @@ static void _display_selection_help(struct dm_report *rh)
log_warn(" size - Floating point value with units, 'm' unit used by default if not specified.");
log_warn(" percent - Non-negative integer with or without %% suffix.");
log_warn(" string - Characters quoted by \' or \" or unquoted.");
- log_warn(" string list - Strings enclosed by [ ] and elements delimited by either");
+ log_warn(" string list - Strings enclosed by [ ] or { } and elements delimited by either");
log_warn(" \"all items must match\" or \"at least one item must match\" operator.");
log_warn(" regular expression - Characters quoted by \' or \" or unquoted.");
log_warn(" ");
diff --git a/man/lvm.8.in b/man/lvm.8.in
index 2faaba4..26d94ee 100644
--- a/man/lvm.8.in
+++ b/man/lvm.8.in
@@ -470,6 +470,10 @@ that can be used in selection, see the output of \fB<lvm reporting command> -S h
\fB[\fP \(em List start
.IP
\fB]\fP \(em List end
+.IP
+\fB{\fP \(em List subset start
+.IP
+\fB}\fP \(em List subset end
.LP
\fBInformal grammar specification\fP:
.IP
@@ -477,7 +481,11 @@ that can be used in selection, see the output of \fB<lvm reporting command> -S h
.IP
.BR VALUE " = " [VALUE " log_op " VALUE]
.br
-For list-based types: string list. The log_op must always be of one type within the whole list value.
+For list-based types: string list. Matches strictly. The log_op must always be of one type within the whole list value.
+.IP
+.BR VALUE " = " {VALUE " log_op " VALUE}
+.br
+For list-based types: string list. Matches a subset. The log_op must always be of one type within the whole list value.
.IP
.BR VALUE " = " value
.br
7 years, 11 months
master - tests: check scsi_debug support opt_blks
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8fdca0de791005...
Commit: 8fdca0de7910052594a55bfb7bd3815afe701dad
Parent: 035276ab83bae4349e06a3158f288fa75e0bdf9c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Apr 7 14:56:16 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Apr 7 14:59:13 2015 +0200
tests: check scsi_debug support opt_blks
Some older kernels (i.e. lenny) do not have such options.
---
test/lib/aux.sh | 2 ++
test/shell/topology-support.sh | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 0dbb8b9..cc102fe 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -320,6 +320,7 @@ prepare_scsi_debug_dev() {
local DEV_SIZE=$1
local SCSI_DEBUG_PARAMS=${@:2}
+ rm -f debug.log strace.log
test ! -f "SCSI_DEBUG_DEV" || return 0
test -z "$LOOP"
test -n "$DM_DEV_DIR"
@@ -331,6 +332,7 @@ prepare_scsi_debug_dev() {
# Create the scsi_debug device and determine the new scsi device's name
# NOTE: it will _never_ make sense to pass num_tgts param;
# last param wins.. so num_tgts=1 is imposed
+ touch SCSI_DEBUG_DEV
modprobe scsi_debug dev_size_mb=$DEV_SIZE $SCSI_DEBUG_PARAMS num_tgts=1 || skip
sleep 2 # allow for async Linux SCSI device registration
diff --git a/test/shell/topology-support.sh b/test/shell/topology-support.sh
index 62f2b88..9bded0e 100644
--- a/test/shell/topology-support.sh
+++ b/test/shell/topology-support.sh
@@ -96,6 +96,9 @@ vgremove $vg
aux cleanup_scsi_debug_dev
+# scsi_debug option opt_blks appeared in Oct 2010
+aux kernel_at_least 2 6 37 || exit 0
+
# ---------------------------------------------
# Create "enterprise-class" 512 drive w/ HW raid stripe_size = 768K
# (logical_block_size=512, physical_block_size=512, alignment_offset=0):
7 years, 11 months
master - lvcreate: do not silently accept '-m #' with raid4/5/6
by Heinz Mauelshagen
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=035276ab83bae4...
Commit: 035276ab83bae4349e06a3158f288fa75e0bdf9c
Parent: 64353ff74b56c71b508fd040a45062facb395bae
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Tue Apr 7 14:32:25 2015 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Tue Apr 7 14:32:25 2015 +0200
lvcreate: do not silently accept '-m #' with raid4/5/6
If the user provides '-m #' (# > 0) with mappings
raid4/5/6, the command silently creates
'#mirrors * #stripes + #parity' image component pairs.
Patch rejects '-m #' altogether for those mappings
in order to avoid LV creation with unexpected layout.
- resolves bz#1209445
---
tools/lvcreate.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index 3f7fe6f..e41f76c 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -474,6 +474,14 @@ static int _read_raid_params(struct cmd_context *cmd,
return 0;
}
+ if (arg_count(cmd, mirrors_ARG) && segtype_is_raid(lp->segtype) &&
+ strcmp(lp->segtype->name, SEG_TYPE_NAME_RAID1) &&
+ strcmp(lp->segtype->name, SEG_TYPE_NAME_RAID10)) {
+ log_error("Mirror argument cannot be used with segment type, %s",
+ lp->segtype->name);
+ return 0;
+ }
+
/* Rates are recorded in kiB/sec/disk, not sectors/sec/disk */
lp->min_recovery_rate = arg_uint_value(cmd, minrecoveryrate_ARG, 0) / 2;
lp->max_recovery_rate = arg_uint_value(cmd, maxrecoveryrate_ARG, 0) / 2;
7 years, 11 months
master - tests: when test fails collect more info
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=64353ff74b56c7...
Commit: 64353ff74b56c71b508fd040a45062facb395bae
Parent: ba049e203b35d6e03e38669a2a92af6538a0b2d0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Apr 7 13:40:15 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Apr 7 13:40:15 2015 +0200
tests: when test fails collect more info
In some case it might be worth to know some more surrouding info
when command has crashed.
So collect tables and some udev db content in this case.
---
test/lib/utils.sh | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/test/lib/utils.sh b/test/lib/utils.sh
index 2f7dc65..401a862 100644
--- a/test/lib/utils.sh
+++ b/test/lib/utils.sh
@@ -130,6 +130,21 @@ STACKTRACE() {
test -z "$LVM_TEST_NODEBUG" -a -f debug.log && {
sed -e "s,^,## DEBUG: ,;s,$top_srcdir/\?,," < debug.log
test -e strace.log && sed -e "s,^,## STRACE: ,;s,$top_srcdir/\?,," < strace.log
+ echo "========= Info ==========="
+ dmsetup info -c | grep "$PREFIX"
+ echo "========= Active table ==========="
+ dmsetup table | grep "$PREFIX"
+ echo "======== Inactive table =========="
+ dmsetup table --inactive | grep "$PREFIX"
+ echo "======== Status =========="
+ dmsetup status | grep "$PREFIX"
+ echo "======== Tree =========="
+ dmsetup ls --tree
+ echo "======== Recursive list of $DM_DEV_DIR =========="
+ ls -Rla "$DM_DEV_DIR"
+ for i in "/sys/block/dm-* /sys/block/loop*" ; do
+ udevadm info --export-db "$i" || true
+ done
}
test -f SKIP_THIS_TEST && exit 200
7 years, 11 months
master - tests: skip clvmd testing of mirrored LV vgsplit
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ba049e203b35d6...
Commit: ba049e203b35d6e03e38669a2a92af6538a0b2d0
Parent: 87cb0a3e9ff3efb35d9383a9044f683e28f41776
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Apr 3 20:14:26 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Apr 3 20:14:26 2015 +0200
tests: skip clvmd testing of mirrored LV vgsplit
There is something wrong when even inactive LV can't be splitted
without cmirrord being present for clustered VG.
---
test/shell/vgsplit-operation.sh | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/test/shell/vgsplit-operation.sh b/test/shell/vgsplit-operation.sh
index 6b478e8..f2baafd 100644
--- a/test/shell/vgsplit-operation.sh
+++ b/test/shell/vgsplit-operation.sh
@@ -119,9 +119,12 @@ COMM "vgsplit correctly splits mirror (log+leg on same dev) into $i VG ($j args)
lvremove -f $vg2/$lv1
vgremove -f $vg1 $vg2
+# Can't use mirrored log without cmirrord
+# TODO: Should work for inactive device, needs some fixes....
+if test ! -e LOCAL_CLVMD ; then
COMM "vgsplit correctly splits mirror LV with mirrored log into $i VG ($j args)"
- create_vg_ -c n $vg1 "$dev1" "$dev2" "$dev3" "$dev4"
- test $i = existing && create_vg_ -c n $vg2 "$dev5"
+ create_vg_ $vg1 "$dev1" "$dev2" "$dev3" "$dev4"
+ test $i = existing && create_vg_ $vg2 "$dev5"
lvcreate -an -Zn -l 64 --mirrorlog mirrored --type mirror -m1 -n $lv1 $vg1 \
"$dev1" "$dev2" "$dev3" "$dev4"
@@ -146,8 +149,8 @@ COMM "vgsplit correctly splits mirror LV with mirrored log into $i VG ($j args)"
# RHBZ 875903
COMM "vgsplit correctly splits mirror LV with mirrored log on same devs into $i VG ($j args)"
- create_vg_ -c n $vg1 "$dev1" "$dev2" "$dev3" "$dev4"
- test $i = existing && create_vg_ -c n $vg2 "$dev5"
+ create_vg_ $vg1 "$dev1" "$dev2" "$dev3" "$dev4"
+ test $i = existing && create_vg_ $vg2 "$dev5"
lvcreate -an -Zn -l 64 --mirrorlog mirrored --type mirror -m1 -n $lv1 $vg1 \
"$dev1" "$dev2"
@@ -166,6 +169,7 @@ COMM "vgsplit correctly splits mirror LV with mirrored log on same devs into $i
fi
lvremove -f $vg2/$lv1
vgremove -f $vg1 $vg2
+fi
COMM "vgsplit correctly splits origin and snapshot LV into $i VG ($j args)"
create_vg_ $vg1 "$dev1" "$dev2"
7 years, 11 months
master - tests: change default to 30s.
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=87cb0a3e9ff3ef...
Commit: 87cb0a3e9ff3efb35d9383a9044f683e28f41776
Parent: 32a0f625a555140adc95a6dc394e6723e5897ea3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Apr 3 19:35:18 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Apr 3 19:40:43 2015 +0200
tests: change default to 30s.
Keep rather the default lower and avoid to pass it with every call.
---
test/lib/aux.sh | 3 ++-
test/shell/pvmove-abort-all.sh | 6 +++---
test/shell/pvmove-abort.sh | 7 ++-----
test/shell/pvmove-restart.sh | 4 ++--
4 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index f4fc1b5..0dbb8b9 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -470,6 +470,7 @@ common_dev_() {
init_udev_transaction
dmsetup load "$name" "$name.devtable"
+ # TODO: add support for resume without udev rescan
dmsetup resume "$name"
finish_udev_transaction
}
@@ -903,7 +904,7 @@ dmsetup_wrapped() {
wait_pvmove_lv_ready() {
# given sleep .1 this is about 60 secs of waiting
- local retries=${2:-600}
+ local retries=${2:-300}
while : ; do
test $retries -le 0 && die "Waiting for pvmove LV to get activated has timed out"
dmsetup info -c -o tables_loaded $1 > out 2>/dev/null|| true;
diff --git a/test/shell/pvmove-abort-all.sh b/test/shell/pvmove-abort-all.sh
index dddf210..235ebd8 100644
--- a/test/shell/pvmove-abort-all.sh
+++ b/test/shell/pvmove-abort-all.sh
@@ -38,12 +38,12 @@ lvcreate -an -Zn -l30 -n $lv1 $vg1 "$dev4"
lvextend -l+30 -n $vg1/$lv1 "$dev5"
pvmove -i1 $backgroundarg "$dev1" "$dev3" $mode &
-aux wait_pvmove_lv_ready "$vg-pvmove0" 300
+aux wait_pvmove_lv_ready "$vg-pvmove0"
pvmove -i1 $backgroundarg "$dev2" "$dev3" $mode &
-aux wait_pvmove_lv_ready "$vg-pvmove1" 300
+aux wait_pvmove_lv_ready "$vg-pvmove1"
pvmove -i1 $backgroundarg -n $vg1/$lv1 "$dev4" "$dev6" $mode &
-aux wait_pvmove_lv_ready "$vg1-pvmove0" 300
+aux wait_pvmove_lv_ready "$vg1-pvmove0"
# test removal of all pvmove LVs
pvmove --abort
diff --git a/test/shell/pvmove-abort.sh b/test/shell/pvmove-abort.sh
index 0efecea..37837ba 100644
--- a/test/shell/pvmove-abort.sh
+++ b/test/shell/pvmove-abort.sh
@@ -32,12 +32,9 @@ lvcreate -an -Zn -l30 -n $lv1 $vg "$dev1"
lvcreate -an -Zn -l30 -n $lv2 $vg "$dev2"
pvmove -i1 $backgroundarg "$dev1" "$dev3" $mode &
-aux wait_pvmove_lv_ready "$vg-pvmove0" 300
+aux wait_pvmove_lv_ready "$vg-pvmove0"
pvmove -i1 $backgroundarg "$dev2" "$dev3" $mode &
-aux wait_pvmove_lv_ready "$vg-pvmove1" 300
-
-# Slow things even more for very slow machines....
-aux delay_dev "$dev3" 0 1000
+aux wait_pvmove_lv_ready "$vg-pvmove1"
# remove specific device
pvmove --abort "$dev1"
diff --git a/test/shell/pvmove-restart.sh b/test/shell/pvmove-restart.sh
index 92e46bf..88dfebe 100644
--- a/test/shell/pvmove-restart.sh
+++ b/test/shell/pvmove-restart.sh
@@ -35,7 +35,7 @@ lvextend -l+10 $vg/$lv1 "$dev2"
pvmove -i0 -n $vg/$lv1 "$dev1" "$dev3" $mode &
PVMOVE=$!
# Let's wait a bit till pvmove starts and kill it
-aux wait_pvmove_lv_ready "$vg-pvmove0" 300
+aux wait_pvmove_lv_ready "$vg-pvmove0"
kill -9 $PVMOVE
wait
@@ -80,7 +80,7 @@ dmsetup table
# Restart pvmove
# use exclusive activation to have usable pvmove without cmirrord
vgchange -aey $vg
-aux wait_pvmove_lv_ready "$vg-pvmove0" 300
+aux wait_pvmove_lv_ready "$vg-pvmove0"
dmsetup table
pvmove --abort
7 years, 11 months
master - tests: slow down devices in outer loop
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=32a0f625a55514...
Commit: 32a0f625a555140adc95a6dc394e6723e5897ea3
Parent: 4f94669eca3c2a90577a972fd748f4b0c4e89928
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Apr 3 19:38:28 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Apr 3 19:40:42 2015 +0200
tests: slow down devices in outer loop
Since now we have metadata parts running with normal speed,
we could avoid reinitilising delayed dev for every test.
(Saving seconds on cookie waits...)
---
test/shell/pvmove-abort-all.sh | 16 ++++++++--------
test/shell/pvmove-abort.sh | 12 ++++++------
test/shell/pvmove-restart.sh | 14 +++++++-------
3 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/test/shell/pvmove-abort-all.sh b/test/shell/pvmove-abort-all.sh
index cf0985d..dddf210 100644
--- a/test/shell/pvmove-abort-all.sh
+++ b/test/shell/pvmove-abort-all.sh
@@ -22,6 +22,10 @@ vgcreate -s 128k $vg1 "$dev4" "$dev5"
pvcreate --metadatacopies 0 "$dev6"
vgextend $vg1 "$dev6"
+# Slowdown writes
+aux delay_dev "$dev3" 100 100 $(get first_extent_sector "$dev3"):
+aux delay_dev "$dev6" 100 100 $(get first_extent_sector "$dev6"):
+
for mode in "--atomic" "" ;
do
for backgroundarg in "-b" "" ;
@@ -33,10 +37,6 @@ lvcreate -an -Zn -l30 -n $lv2 $vg "$dev2"
lvcreate -an -Zn -l30 -n $lv1 $vg1 "$dev4"
lvextend -l+30 -n $vg1/$lv1 "$dev5"
-# Slowdown writes
-aux delay_dev "$dev3" 100 100 $(get first_extent_sector "$dev3"):
-aux delay_dev "$dev6" 100 100 $(get first_extent_sector "$dev6"):
-
pvmove -i1 $backgroundarg "$dev1" "$dev3" $mode &
aux wait_pvmove_lv_ready "$vg-pvmove0" 300
pvmove -i1 $backgroundarg "$dev2" "$dev3" $mode &
@@ -54,14 +54,14 @@ not grep "^\[pvmove" out
get lv_field $vg1 name -a | tee out
not grep "^\[pvmove" out
-# Restore delayed device back
-aux enable_dev "$dev3"
-aux enable_dev "$dev6"
-
lvremove -ff $vg $vg1
wait
done
done
+# Restore delayed device back
+aux enable_dev "$dev3"
+aux enable_dev "$dev6"
+
vgremove -ff $vg $vg1
diff --git a/test/shell/pvmove-abort.sh b/test/shell/pvmove-abort.sh
index 4ad3e62..0efecea 100644
--- a/test/shell/pvmove-abort.sh
+++ b/test/shell/pvmove-abort.sh
@@ -19,6 +19,9 @@ vgcreate -s 128k $vg "$dev1" "$dev2"
pvcreate --metadatacopies 0 "$dev3"
vgextend $vg "$dev3"
+# Slowdown read/writes
+aux delay_dev "$dev3" 100 100 $(get first_extent_sector "$dev3"):
+
for mode in "--atomic" "" ;
do
for backgroundarg in "-b" "" ;
@@ -28,9 +31,6 @@ do
lvcreate -an -Zn -l30 -n $lv1 $vg "$dev1"
lvcreate -an -Zn -l30 -n $lv2 $vg "$dev2"
-# Slowdown writes
-aux delay_dev "$dev3" 0 200
-
pvmove -i1 $backgroundarg "$dev1" "$dev3" $mode &
aux wait_pvmove_lv_ready "$vg-pvmove0" 300
pvmove -i1 $backgroundarg "$dev2" "$dev3" $mode &
@@ -47,9 +47,6 @@ get lv_field $vg name -a | tee out
not grep "^\[pvmove0\]" out
grep "^\[pvmove1\]" out
-# Restore delayed device back
-aux enable_dev "$dev3"
-
# remove any remaining pvmoves in progress
pvmove --abort
@@ -59,4 +56,7 @@ wait
done
done
+# Restore delayed device back
+aux enable_dev "$dev3"
+
vgremove -ff $vg
diff --git a/test/shell/pvmove-restart.sh b/test/shell/pvmove-restart.sh
index 9426d52..92e46bf 100644
--- a/test/shell/pvmove-restart.sh
+++ b/test/shell/pvmove-restart.sh
@@ -19,6 +19,10 @@ vgcreate -s 128k $vg "$dev1" "$dev2"
pvcreate --metadatacopies 0 "$dev3"
vgextend $vg "$dev3"
+# Slowdown writes
+# (FIXME: generates interesting race when not used)
+aux delay_dev "$dev3" 100 100 $(get first_extent_sector "$dev3"):
+
for mode in "--atomic" ""
do
@@ -28,10 +32,6 @@ lvextend -l+10 $vg/$lv1 "$dev2"
lvextend -l+5 $vg/$lv1 "$dev1"
lvextend -l+10 $vg/$lv1 "$dev2"
-# Slowdown writes
-# (FIXME: generates interesting race when not used)
-aux delay_dev "$dev3" 100 100 $(get first_extent_sector "$dev3"):
-
pvmove -i0 -n $vg/$lv1 "$dev1" "$dev3" $mode &
PVMOVE=$!
# Let's wait a bit till pvmove starts and kill it
@@ -87,12 +87,12 @@ pvmove --abort
pvmove --abort
-# Restore delayed device back
-aux delay_dev "$dev3"
-
lvs -a -o+devices $vg
lvremove -ff $vg
done
+# Restore delayed device back
+aux delay_dev "$dev3"
+
vgremove -ff $vg
7 years, 11 months
master - pvmove: don't crash when name is not found
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4f94669eca3c2a...
Commit: 4f94669eca3c2a90577a972fd748f4b0c4e89928
Parent: c88ffbf9dfab5c636b45c51fda6ecf1e6f270b85
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Apr 3 17:14:50 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Apr 3 17:18:11 2015 +0200
pvmove: don't crash when name is not found
If the device name is not found in our metadata,
we cannot call strdup few lines later with NULL name.
More intersting story goes behind how it happens -
pvmove removal is unfortunatelly 'multi-state' process
and at some point (for now) we have in lvm2 metadata
LV pvmove0 as stripe and mirror image as error.
If such metadata are left - we fail with any further removal.
---
tools/polldaemon.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/tools/polldaemon.c b/tools/polldaemon.c
index 6cdcbbb..1b6e1b4 100644
--- a/tools/polldaemon.c
+++ b/tools/polldaemon.c
@@ -223,6 +223,12 @@ static int _poll_vg(struct cmd_context *cmd, const char *vgname,
if (!name && !parms->aborting)
continue;
+ if (!name) {
+ log_error("Device name for LV %s not found in metadata. "
+ "(unfinished pvmove mirror removal?)", display_lvname(lv));
+ goto err;
+ }
+
/* FIXME Need to do the activation from _set_up_pvmove here
* if it's not running and we're not aborting. */
if (!lv_is_active(lv)) {
7 years, 11 months