Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=666738d57a6e6b40…
Commit: 666738d57a6e6b4005030995a9641933c1a54e9d
Parent: 139df7c4a310486d49fdd95039891b91f793ff44
Author: Michael Lass <bevan(a)bi-co.net>
AuthorDate: Tue Mar 31 15:47:01 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Mar 31 15:47:01 2015 +0200
systemd: stop lvm2-pvscan@.service before lvm2-lvmetad.service
When lvm2-pvscan@.service and lvm2-lvmetad.service are scheduled to be
stopped lvm2-pvscan@.service should be stopped first since pvscan uses
lvmetad.
This is especially important if lvm2-lvmetad.socket is also scheduled to
be stopped as in this case connection requests are suppressed causing
pvscan to fail.
---
scripts/lvm2_pvscan_systemd_red_hat@.service.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/scripts/lvm2_pvscan_systemd_red_hat@.service.in b/scripts/lvm2_pvscan_systemd_red_hat@.service.in
index 7d3b291..03651d5 100644
--- a/scripts/lvm2_pvscan_systemd_red_hat@.service.in
+++ b/scripts/lvm2_pvscan_systemd_red_hat@.service.in
@@ -4,7 +4,7 @@ Documentation=man:pvscan(8)
DefaultDependencies=no
BindsTo=dev-block-%i.device
Requires=lvm2-lvmetad.socket
-After=lvm2-lvmetad.socket
+After=lvm2-lvmetad.socket lvm2-lvmetad.service
Before=shutdown.target
Conflicts=shutdown.target
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=139df7c4a310486d…
Commit: 139df7c4a310486d49fdd95039891b91f793ff44
Parent: 974a029a8a181b3bc8ee5f10b202408b175d1b4b
Author: Michael Lass <bevan(a)bi-co.net>
AuthorDate: Tue Mar 31 15:44:00 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Mar 31 15:44:00 2015 +0200
README: fix link to lvm-devel mailing list
---
README | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/README b/README
index 6a7e11c..a0e3c9e 100644
--- a/README
+++ b/README
@@ -18,7 +18,7 @@ Mailing list for general discussion related to LVM2:
Mailing lists for LVM2 development, patches and commits:
lvm-devel(a)redhat.com
- Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm
+ Subscribe from https://www.redhat.com/mailman/listinfo/lvm-devel
lvm2-commits(a)lists.fedorahosted.org (Read-only archive of commits)
Subscribe from https://fedorahosted.org/mailman/listinfo/lvm2-commits
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=974a029a8a181b3b…
Commit: 974a029a8a181b3bc8ee5f10b202408b175d1b4b
Parent: 04826db7c415028cb4a16bdde5553859779380ac
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Mar 31 15:38:29 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Mar 31 15:38:29 2015 +0200
lvm.conf: fix typo as -> is in read_only_volume_list comments
---
conf/example.conf.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index 51e8e85..1863a89 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -997,7 +997,7 @@ activation {
# auto_activation_volume_list = [ "vg1", "vg2/lvol1", "@tag1", "@*" ]
# If read_only_volume_list is defined, each LV that is to be activated
- # is checked against the list, and if it matches, it as activated
+ # is checked against the list, and if it matches, it is activated
# in read-only mode. (This overrides '--permission rw' stored in the
# metadata.)
#
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b9e6e66de15ca638…
Commit: b9e6e66de15ca638ca504a07d6476e571a6197d3
Parent: 5f7428e4d54254943da721f7ce11ae90aaa3f5a4
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Mon Mar 30 16:59:51 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Mon Mar 30 18:39:30 2015 +0200
tests: add pvmove --abort for all moves in progress
test for bug described in c282a66132063d702d1df1e342961f75a5ffcdd2
---
test/shell/pvmove-abort-all.sh | 68 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 68 insertions(+), 0 deletions(-)
diff --git a/test/shell/pvmove-abort-all.sh b/test/shell/pvmove-abort-all.sh
new file mode 100644
index 0000000..85ee457
--- /dev/null
+++ b/test/shell/pvmove-abort-all.sh
@@ -0,0 +1,68 @@
+#!/bin/sh
+# Copyright (C) 2015 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# Check pvmove --abort behaviour for all VGs and PVs
+
+. lib/inittest
+
+aux prepare_pvs 6 60
+
+vgcreate -s 128k $vg "$dev1" "$dev2"
+pvcreate --metadatacopies 0 "$dev3"
+vgextend $vg "$dev3"
+vgcreate -s 128k $vg1 "$dev4" "$dev5"
+pvcreate --metadatacopies 0 "$dev6"
+vgextend $vg1 "$dev6"
+
+for mode in "--atomic" "" ;
+do
+for backgroundarg in "-b" "" ;
+do
+
+# Create multisegment LV
+lvcreate -an -Zn -l30 -n $lv1 $vg "$dev1"
+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" 0 300
+aux delay_dev "$dev6" 0 300
+
+pvmove -i1 $backgroundarg "$dev1" "$dev3" $mode &
+aux wait_pvmove_lv_ready "$vg-pvmove0" 300
+pvmove -i1 $backgroundarg "$dev2" "$dev3" $mode &
+aux wait_pvmove_lv_ready "$vg-pvmove1" 300
+pvmove -i1 $backgroundarg -n $vg1/$lv1 "$dev4" "$dev6" $mode &
+aux wait_pvmove_lv_ready "$vg1-pvmove0" 300
+
+# test removal of all pvmove LVs
+pvmove --abort
+
+# check if proper pvmove was canceled
+get lv_field $vg name -a | tee out
+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
+lvremove -ff $vg1
+
+wait
+done
+done
+
+vgremove -ff $vg
+vgremove -ff $vg1
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5f7428e4d5425494…
Commit: 5f7428e4d54254943da721f7ce11ae90aaa3f5a4
Parent: c282a66132063d702d1df1e342961f75a5ffcdd2
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Mon Mar 30 16:59:06 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Mon Mar 30 18:39:24 2015 +0200
tests: add pvmove --abort test
test for bug described in c282a66132063d702d1df1e342961f75a5ffcdd2
---
test/shell/pvmove-abort.sh | 59 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 59 insertions(+), 0 deletions(-)
diff --git a/test/shell/pvmove-abort.sh b/test/shell/pvmove-abort.sh
new file mode 100644
index 0000000..6798b59
--- /dev/null
+++ b/test/shell/pvmove-abort.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+# Copyright (C) 2015 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# Check pvmove --abort behaviour when specific device is requested
+
+. lib/inittest
+
+aux prepare_pvs 3 60
+
+vgcreate -s 128k $vg "$dev1" "$dev2"
+pvcreate --metadatacopies 0 "$dev3"
+vgextend $vg "$dev3"
+
+for mode in "--atomic" "" ;
+do
+for backgroundarg in "-b" "" ;
+do
+
+# Create multisegment LV
+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 &
+aux wait_pvmove_lv_ready "$vg-pvmove1" 300
+
+# remove specific device
+pvmove --abort "$dev1"
+
+# check if proper pvmove was canceled
+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
+
+lvremove -ff $vg
+
+wait
+done
+done
+
+vgremove -ff $vg
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c282a66132063d70…
Commit: c282a66132063d702d1df1e342961f75a5ffcdd2
Parent: 7c66850ce506d9a8bdae74f999a658507943d57c
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Mon Mar 30 16:25:04 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Mon Mar 30 18:38:50 2015 +0200
pvmove: fix pvmove --abort or pvmove w/o parameters
_check_lv_status was called from within dm_list_iterate_items cycle.
This was utterly wrong! _check_lv_status may remove more than one LV from
vg->lvs list we iterated in the same time.
In some scenarios this could lead to deadlock iterationg over same LV
indefinitely or segfault depending on the circumstances.
Fixed by moving the _check_lv_status outside iterating the vg->lvs
list.
Note that commit 6e7b24d34ff3da1c56718bb7def8a8ecd4258c43 was not enough
as _check_lv_status may result in removal of more than one LV from the list.
---
tools/polldaemon.c | 42 ++++++++++++++++++++++++++++++++++++------
1 files changed, 36 insertions(+), 6 deletions(-)
diff --git a/tools/polldaemon.c b/tools/polldaemon.c
index 53dab96..5383812 100644
--- a/tools/polldaemon.c
+++ b/tools/polldaemon.c
@@ -192,7 +192,9 @@ static int _poll_vg(struct cmd_context *cmd, const char *vgname,
struct volume_group *vg, struct processing_handle *handle)
{
struct daemon_parms *parms = (struct daemon_parms *) handle->custom_handle;
- struct lv_list *lvl, *tmp_lvl;
+ struct lv_list *lvl;
+ struct dm_list *sls;
+ struct dm_str_list *sl;
struct logical_volume *lv;
const char *name;
int finished;
@@ -202,7 +204,18 @@ static int _poll_vg(struct cmd_context *cmd, const char *vgname,
return ECMD_FAILED;
}
- dm_list_iterate_items_safe(lvl, tmp_lvl, &vg->lvs) {
+ if (!(sls = str_list_create(cmd->mem)))
+ return ECMD_FAILED;
+
+ log_verbose("Looking for pvmove LVs in VG: %s.", vg->name);
+
+ /*
+ * _check_lv_status must not be called from within any
+ * dm_list_iterate_ routine with vg->lvs as list head.
+ * It may remove more than one LV in the process thus
+ * even "*_safe" variant won't help.
+ */
+ dm_list_iterate_items(lvl, &vg->lvs) {
lv = lvl->lv;
if (!(lv->status & parms->lv_type))
continue;
@@ -217,13 +230,30 @@ static int _poll_vg(struct cmd_context *cmd, const char *vgname,
continue;
}
- if (_check_lv_status(cmd, vg, lv, name, parms, &finished) &&
- !finished)
- parms->outstanding_count++;
+ if (!str_list_add(cmd->mem, sls, dm_pool_strdup(cmd->mem, name)))
+ {
+ log_error("Failed to clone pvname");
+ goto err;
+ }
+
+ log_verbose("Found LV: %s/%s. It belongs to pvmove task on PV %s.", lv->vg->name, lv->name, name);
}
- return ECMD_PROCESSED;
+ dm_list_iterate_items(sl, sls) {
+ lv = parms->poll_fns->get_copy_lv(cmd, vg, sl->str, NULL, parms->lv_type);
+ if (lv) {
+ log_verbose("About to call _check_lv_status on LV: %s/%s, name: %s",
+ lv->vg->name, lv->name, sl->str);
+ if (_check_lv_status(cmd, vg, lv, sl->str, parms, &finished) &&
+ !finished)
+ parms->outstanding_count++;
+ }
+ }
+
+err:
+ dm_pool_free(cmd->mem, sls);
+ return ECMD_PROCESSED;
}
static void _poll_for_all_vgs(struct cmd_context *cmd,