Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d09246a07d3e4d99…
Commit: d09246a07d3e4d9940cdbbd017b1bc8319384081
Parent: 40701af9696a302c904fad30951385eb5a5adb85
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Thu Jan 7 15:30:22 2016 +0100
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Tue Jan 12 11:40:43 2016 +0100
test: add test for autoactivation regression
add test for a regression fixed in
40701af9696a302c904fad30951385eb5a5adb85
---
.../shell/lvmetad-pvscan-autoactivation-polling.sh | 70 ++++++++++++++++++++
1 files changed, 70 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvmetad-pvscan-autoactivation-polling.sh b/test/shell/lvmetad-pvscan-autoactivation-polling.sh
new file mode 100644
index 0000000..f7ea912
--- /dev/null
+++ b/test/shell/lvmetad-pvscan-autoactivation-polling.sh
@@ -0,0 +1,70 @@
+#!/bin/sh
+# Copyright (C) 2016 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
+
+SKIP_WITHOUT_LVMETAD=1
+
+. lib/inittest
+
+which mkfs.ext3 || skip
+
+lvdev_() {
+ echo "$DM_DEV_DIR/$1/$2"
+}
+
+snap_lv_name_() {
+ echo ${1}_snap
+}
+
+setup_merge_() {
+ local VG_NAME=$1
+ local LV_NAME=$2
+ local NUM_EXTRA_SNAPS=${3:-0}
+ local BASE_SNAP_LV_NAME
+
+ BASE_SNAP_LV_NAME=$(snap_lv_name_ $LV_NAME)
+
+ lvcreate -aey -n $LV_NAME -l 50%FREE $VG_NAME
+ lvs
+ lvcreate -s -n $BASE_SNAP_LV_NAME -l 20%FREE ${VG_NAME}/${LV_NAME}
+ mkfs.ext3 "$(lvdev_ $VG_NAME $LV_NAME)"
+
+ if [ $NUM_EXTRA_SNAPS -gt 0 ]; then
+ for i in $(seq 1 $NUM_EXTRA_SNAPS); do
+ lvcreate -s -n ${BASE_SNAP_LV_NAME}_${i} -l 20%ORIGIN ${VG_NAME}/${LV_NAME}
+ done
+ fi
+}
+
+aux prepare_pvs 1 50
+
+vgcreate $vg1 "$dev1"
+mkdir test_mnt
+
+setup_merge_ $vg1 $lv1
+mount "$(lvdev_ $vg1 $lv1)" test_mnt
+lvconvert --merge $vg1/$(snap_lv_name_ $lv1)
+umount test_mnt
+vgchange -an $vg1
+
+# check snapshot get removed on autoactivation
+pvscan --cache -aay "$dev1"
+
+check active $vg1 $lv1
+i=100
+while ! check lv_not_exists $vg1/$(snap_lv_name_ $lv1); do
+ test $i -lt 0 && fail "Background polling failed to remove merged snapshot LV"
+ sleep .1
+ i=$((i-1))
+done
+
+# TODO: add similar simple tests for other interrupted/unfinished polling operation
+
+vgremove -ff $vg1
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a83d611a86e6da31…
Commit: a83d611a86e6da31f255d5d87adf14cb3d62a05a
Parent: 0dac4f09b4fcf752b039a80707653d3b655fc020
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Jan 11 12:51:08 2016 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Jan 11 12:51:08 2016 +0100
report: fix invalid memory read when reporting cache LV policy name
Fix regression caused by commit c2d4330f27277717bc3b684b702189079b257b77
which removed the dm_pool_strdup for the cache policy name in
_cache_policy_disp report function.
This regression was hit with buffered reporting only (which is
used by default). The reason is that for buffered reporting, we're
iterating over LVs in VG (process_each_lv) while gathering
all the information that is needed for the report. In this case,
the LV's cache policy name has not been duped, but only the pointer
to the original VG buffer was stored. When the LV iteration finished,
the VG buffer was freed and any report to output called later
(dm_report_output call) accessed already freed VG data.
This didn't appear if unbuffered reporting was used (--unbuffered)
because in this case, the data were reported to output as
soon as they were processed, hence it was reported to output
before the VG data was freed.
---
WHATS_NEW | 1 +
lib/report/report.c | 8 +++++++-
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 15f835b..d622c9f 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.140 -
===================================
+ Fix invalid memory read when reporting cache LV policy_name (2.02.126).
Version 2.02.139 - 8th January 2016
===================================
diff --git a/lib/report/report.c b/lib/report/report.c
index 91522b1..2fdf509 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -1417,6 +1417,7 @@ static int _cache_policy_disp(struct dm_report *rh, struct dm_pool *mem,
const void *data, void *private)
{
const struct lv_segment *seg = (const struct lv_segment *) data;
+ const char *cache_policy_name;
if (seg_is_cache(seg))
seg = first_seg(seg->pool_lv);
@@ -1429,7 +1430,12 @@ static int _cache_policy_disp(struct dm_report *rh, struct dm_pool *mem,
return 0;
}
- return _field_set_value(field, seg->policy_name, NULL);
+ if (!(cache_policy_name = dm_pool_strdup(mem, seg->policy_name))) {
+ log_error("dm_pool_strdup failed");
+ return 0;
+ }
+
+ return _field_set_value(field, cache_policy_name, NULL);
}
static int _modules_disp(struct dm_report *rh, struct dm_pool *mem,
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a52e23085dd84bb3…
Commit: a52e23085dd84bb3b62d44cd28b421004c7a19c5
Parent: 0000000000000000000000000000000000000000
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: 2016-01-08 18:47 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: 2016-01-08 18:47 +0000
annotated tag: v2_02_139 has been created
at a52e23085dd84bb3b62d44cd28b421004c7a19c5 (tag)
tagging 04b82a81262c2da3b7254c884e6df46d59c69c4a (commit)
replaces v2_02_138
Release 2.02.139.
21 files changed, 330 insertions(+), 193 deletions(-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
iEYEABECAAYFAlaQBGgACgkQIoGRwVZ+LBeXRACg0L0Xsfn9Be8RSX+t+zcAKqxT
VuYAn3xQ2DZSLSRJ1bjOZQ+23A3heErl
=5QIx
-----END PGP SIGNATURE-----
Alasdair G Kergon (3):
post-release
pvscan: Remove duplicate filter wipe.
pre-release
David Teigland (4):
process_each_pv: do full scan earlier to find new devices
vgrename: use process_each_vg
lvmlockd: update VG lock version earlier
document commits since last release
Peter Rajnoha (2):
lvmdump: also add lvm2-activation{-early,-net}.service systemd status for lvmdump -s
man: lvs: document F,D and M thin pool health status chars for lv_attr in lvs man page