master - report: use proper string reference in _string_disp call for _cache_policy_disp fn
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=176b4aaebeb8b8...
Commit: 176b4aaebeb8b885d5df16172a5bc32481beda59
Parent: 1a3ee6402ecf761554040a551f6c7f52b92f73ca
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Jan 12 16:13:56 2016 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Jan 12 16:14:23 2016 +0100
report: use proper string reference in _string_disp call for _cache_policy_disp fn
---
lib/report/report.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/report/report.c b/lib/report/report.c
index 17aa5c0..9f44212 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -1429,7 +1429,7 @@ static int _cache_policy_disp(struct dm_report *rh, struct dm_pool *mem,
return 0;
}
- return _string_disp(rh, mem, field, seg->policy_name, private);
+ return _string_disp(rh, mem, field, &seg->policy_name, private);
}
static int _modules_disp(struct dm_report *rh, struct dm_pool *mem,
8 years, 3 months
master - test: conditional skip of auto-activation bg polling test
by okozina
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1a3ee6402ecf76...
Commit: 1a3ee6402ecf761554040a551f6c7f52b92f73ca
Parent: d1e30ff0baa3cf4ae0c582c29dc017d63ca99483
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Tue Jan 12 13:24:12 2016 +0100
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Tue Jan 12 13:32:23 2016 +0100
test: conditional skip of auto-activation bg polling test
if dm-snapshot-merge target not present skip whole test
---
.../shell/lvmetad-pvscan-autoactivation-polling.sh | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvmetad-pvscan-autoactivation-polling.sh b/test/shell/lvmetad-pvscan-autoactivation-polling.sh
index f7ea912..08e00e0 100644
--- a/test/shell/lvmetad-pvscan-autoactivation-polling.sh
+++ b/test/shell/lvmetad-pvscan-autoactivation-polling.sh
@@ -13,6 +13,9 @@ SKIP_WITHOUT_LVMETAD=1
. lib/inittest
+# test if snapshot-merge target is available
+aux target_at_least dm-snapshot-merge 1 0 0 || skip
+
which mkfs.ext3 || skip
lvdev_() {
8 years, 3 months
master - vgchange: drop redundant check
by okozina
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d1e30ff0baa3cf...
Commit: d1e30ff0baa3cf4ae0c582c29dc017d63ca99483
Parent: d09246a07d3e4d9940cdbbd017b1bc8319384081
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Tue Jan 12 10:15:10 2016 +0100
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Tue Jan 12 11:41:41 2016 +0100
vgchange: drop redundant check
check for background polling option is performed from
within vgchange_background_polling routine as well.
---
tools/vgchange.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/tools/vgchange.c b/tools/vgchange.c
index 3aea8a4..62e602a 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -998,8 +998,7 @@ static int vgchange_single(struct cmd_context *cmd, const char *vg_name,
}
if (!arg_count(cmd, refresh_ARG) &&
- background_polling())
- if (!vgchange_background_polling(cmd, vg))
+ !vgchange_background_polling(cmd, vg))
return_ECMD_FAILED;
if (arg_is_set(cmd, lockstart_ARG)) {
8 years, 3 months
master - test: add test for autoactivation regression
by okozina
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d09246a07d3e4d...
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
8 years, 3 months
master - pvscan: restore polling in autoactivation handler
by okozina
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=40701af9696a30...
Commit: 40701af9696a302c904fad30951385eb5a5adb85
Parent: d6cf83968cb0d397faec30ce54839a679e89dd14
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Thu Jan 7 15:17:08 2016 +0100
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Tue Jan 12 11:40:43 2016 +0100
pvscan: restore polling in autoactivation handler
This commit fixes regression in auto-activation code introduced
in commit: c26d81d6e6939906729d91fae83cd8bbdd743bb7.
- resolves rhbz1295562
---
WHATS_NEW | 1 +
tools/pvscan.c | 9 +++++++++
tools/tools.h | 2 ++
tools/vgchange.c | 4 ++--
4 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index f316054..93e0dd5 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.140 -
===================================
+ Restore background polling processing during auto-activation (2.02.119).
Use brackets to signify LVs which are not visible when reporting lv_parent.
Fix invalid memory read when reporting cache LV policy_name (2.02.126).
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 68a074e..e9fb5d5 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -190,6 +190,15 @@ static int _auto_activation_handler(struct cmd_context *cmd,
goto out;
}
+ /*
+ * After sucessfull activation we need to initialise polling
+ * for all activated LVs in a VG. Possible enhancement would
+ * be adding --poll y|n cmdline option for pvscan and call
+ * init_background_polling routine in autoactivation handler.
+ */
+ if (!(vgchange_background_polling(vg->cmd, vg)))
+ goto_out;
+
r = 1;
out:
diff --git a/tools/tools.h b/tools/tools.h
index 4179cc8..47dd35e 100644
--- a/tools/tools.h
+++ b/tools/tools.h
@@ -185,4 +185,6 @@ int mirror_remove_missing(struct cmd_context *cmd,
int vgchange_activate(struct cmd_context *cmd, struct volume_group *vg,
activation_change_t activate);
+int vgchange_background_polling(struct cmd_context *cmd, struct volume_group *vg);
+
#endif
diff --git a/tools/vgchange.c b/tools/vgchange.c
index 9e1b09e..3aea8a4 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -174,7 +174,7 @@ static int _vgchange_monitoring(struct cmd_context *cmd, struct volume_group *vg
return r;
}
-static int _vgchange_background_polling(struct cmd_context *cmd, struct volume_group *vg)
+int vgchange_background_polling(struct cmd_context *cmd, struct volume_group *vg)
{
int polled;
@@ -999,7 +999,7 @@ static int vgchange_single(struct cmd_context *cmd, const char *vg_name,
if (!arg_count(cmd, refresh_ARG) &&
background_polling())
- if (!_vgchange_background_polling(cmd, vg))
+ if (!vgchange_background_polling(cmd, vg))
return_ECMD_FAILED;
if (arg_is_set(cmd, lockstart_ARG)) {
8 years, 3 months
master - report: use brackets to signify LVs which are not visible when reporting lv_parent
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d6cf83968cb0d3...
Commit: d6cf83968cb0d397faec30ce54839a679e89dd14
Parent: f03a21f5b81dae3a1280fdd3704950e90eff13b2
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Jan 11 15:34:35 2016 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Jan 11 15:34:35 2016 +0100
report: use brackets to signify LVs which are not visible when reporting lv_parent
Use common _lvname_disp to report lv_parent. The _lvname_disp
takes care of properly marking LVs which are not visible - such
LVs are always enclosed in brackets when reported within any
other field.
For example, thin pool over RAID.
Before:
$ lvs -a -o name,lv_parent,data_lv,metadata_lv vg
LV Parent Data Meta
cache_pool [cache_pool_tdata] [cache_pool_tmeta]
[cache_pool_tdata] cache_pool
[cache_pool_tdata_rimage_0] cache_pool_tdata
[cache_pool_tdata_rimage_1] cache_pool_tdata
[cache_pool_tdata_rmeta_0] cache_pool_tdata
[cache_pool_tdata_rmeta_1] cache_pool_tdata
[cache_pool_tmeta] cache_pool
[cache_pool_tmeta_rimage_0] cache_pool_tmeta
[cache_pool_tmeta_rimage_1] cache_pool_tmeta
[cache_pool_tmeta_rmeta_0] cache_pool_tmeta
[cache_pool_tmeta_rmeta_1] cache_pool_tmeta
[lvol0_pmspare]
With this patch applied:
$ lvs -a -o name,lv_parent,data_lv,metadata_lv vg
LV Parent Data Meta
cache_pool [cache_pool_tdata] [cache_pool_tmeta]
[cache_pool_tdata] cache_pool
[cache_pool_tdata_rimage_0] [cache_pool_tdata]
[cache_pool_tdata_rimage_1] [cache_pool_tdata]
[cache_pool_tdata_rmeta_0] [cache_pool_tdata]
[cache_pool_tdata_rmeta_1] [cache_pool_tdata]
[cache_pool_tmeta] cache_pool
[cache_pool_tmeta_rimage_0] [cache_pool_tmeta]
[cache_pool_tmeta_rimage_1] [cache_pool_tmeta]
[cache_pool_tmeta_rmeta_0] [cache_pool_tmeta]
[cache_pool_tmeta_rmeta_1] [cache_pool_tmeta]
[lvol0_pmspare]
---
WHATS_NEW | 1 +
lib/report/report.c | 10 +++++-----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index d622c9f..f316054 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.140 -
===================================
+ Use brackets to signify LVs which are not visible when reporting lv_parent.
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 bb2736f..17aa5c0 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -1655,15 +1655,15 @@ static int _lvfullname_disp(struct dm_report *rh, struct dm_pool *mem,
static int _lvparent_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field,
- const void *data, void *private __attribute__((unused)))
+ const void *data, void *private)
{
const struct logical_volume *lv = (const struct logical_volume *) data;
- char *repstr;
+ struct logical_volume *parent_lv = lv_parent(lv);
- if (!(repstr = lv_parent_dup(mem, lv)))
- return_0;
+ if (!parent_lv)
+ return _field_set_value(field, "", NULL);
- return _field_set_value(field, repstr, NULL);
+ return _lvname_disp(rh, mem, field, parent_lv, private);
}
static int _do_datalv_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)),
8 years, 3 months
master - cleanup: use _field_set_value and _string_disp consistently in report.c
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f03a21f5b81dae...
Commit: f03a21f5b81dae3a1280fdd3704950e90eff13b2
Parent: a83d611a86e6da31f255d5d87adf14cb3d62a05a
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Jan 11 15:01:35 2016 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Jan 11 15:01:42 2016 +0100
cleanup: use _field_set_value and _string_disp consistently in report.c
Do not mix dm_report_field_set_value and _field_set_value and
use single function call throughout for clarity. The same applies
for dm_report_field_string and _string_disp.
---
lib/report/report.c | 50 +++++++++++++++++++++-----------------------------
1 files changed, 21 insertions(+), 29 deletions(-)
diff --git a/lib/report/report.c b/lib/report/report.c
index 2fdf509..bb2736f 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -1283,13 +1283,13 @@ static int _uuid_disp(struct dm_report *rh __attribute__((unused)), struct dm_po
return _field_set_value(field, repstr, NULL);
}
-static int _dev_name_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)),
+static int _dev_name_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field,
- const void *data, void *private __attribute__((unused)))
+ const void *data, void *private)
{
const char *name = dev_name(*(const struct device * const *) data);
- return dm_report_field_string(rh, field, &name);
+ return _string_disp(rh, mem, field, &name, private);
}
static int _devices_disp(struct dm_report *rh __attribute__((unused)), struct dm_pool *mem,
@@ -1417,7 +1417,6 @@ 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);
@@ -1430,12 +1429,7 @@ static int _cache_policy_disp(struct dm_report *rh, struct dm_pool *mem,
return 0;
}
- 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);
+ return _string_disp(rh, mem, field, seg->policy_name, private);
}
static int _modules_disp(struct dm_report *rh, struct dm_pool *mem,
@@ -1463,7 +1457,7 @@ static int _lvprofile_disp(struct dm_report *rh, struct dm_pool *mem,
const struct logical_volume *lv = (const struct logical_volume *) data;
if (lv->profile)
- return dm_report_field_string(rh, field, &lv->profile->name);
+ return _string_disp(rh, mem, field, &lv->profile->name, private);
return _field_set_value(field, "", NULL);
}
@@ -1497,10 +1491,8 @@ static int _pvfmt_disp(struct dm_report *rh, struct dm_pool *mem,
const struct label *l =
(const struct label *) data;
- if (!l->labeller || !l->labeller->fmt) {
- dm_report_field_set_value(field, "", NULL);
- return 1;
- }
+ if (!l->labeller || !l->labeller->fmt)
+ return _field_set_value(field, "", NULL);
return _string_disp(rh, mem, field, &l->labeller->fmt->name, private);
}
@@ -1585,9 +1577,9 @@ static int _segtype_disp(struct dm_report *rh __attribute__((unused)),
return _field_set_value(field, name, NULL);
}
-static int _do_loglv_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)),
+static int _do_loglv_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field,
- const void *data, void *private __attribute__((unused)),
+ const void *data, void *private,
int uuid)
{
const struct logical_volume *lv = (const struct logical_volume *) data;
@@ -1599,7 +1591,7 @@ static int _do_loglv_disp(struct dm_report *rh, struct dm_pool *mem __attribute_
repstr = lv_mirror_log_dup(mem, lv);
if (repstr)
- return dm_report_field_string(rh, field, &repstr);
+ return _string_disp(rh, mem, field, &repstr, private);
return _field_set_value(field, "", NULL);
}
@@ -1620,14 +1612,14 @@ static int _loglvuuid_disp(struct dm_report *rh, struct dm_pool *mem __attribute
static int _lvname_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field,
- const void *data, void *private __attribute__((unused)))
+ const void *data, void *private)
{
const struct logical_volume *lv = (const struct logical_volume *) data;
char *repstr, *lvname;
size_t len;
if (lv_is_visible(lv))
- return dm_report_field_string(rh, field, &lv->name);
+ return _string_disp(rh, mem, field, &lv->name, private);
len = strlen(lv->name) + 3;
if (!(repstr = dm_pool_zalloc(mem, len))) {
@@ -1937,9 +1929,9 @@ static int _lvdescendants_disp(struct dm_report *rh, struct dm_pool *mem,
return _field_set_string_list(rh, field, descendants.result, private, 0);
}
-static int _do_movepv_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)),
+static int _do_movepv_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field,
- const void *data, void *private __attribute__((unused)),
+ const void *data, void *private,
int uuid)
{
const struct logical_volume *lv = (const struct logical_volume *) data;
@@ -1951,7 +1943,7 @@ static int _do_movepv_disp(struct dm_report *rh, struct dm_pool *mem __attribute
repstr = lv_move_pv_dup(mem, lv);
if (repstr)
- return dm_report_field_string(rh, field, &repstr);
+ return _string_disp(rh, mem, field, &repstr, private);
return _field_set_value(field, "", NULL);
}
@@ -1970,9 +1962,9 @@ static int _movepvuuid_disp(struct dm_report *rh, struct dm_pool *mem __attribut
return _do_movepv_disp(rh, mem, field, data, private, 1);
}
-static int _do_convertlv_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)),
+static int _do_convertlv_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field,
- const void *data, void *private __attribute__((unused)),
+ const void *data, void *private,
int uuid)
{
const struct logical_volume *lv = (const struct logical_volume *) data;
@@ -1984,7 +1976,7 @@ static int _do_convertlv_disp(struct dm_report *rh, struct dm_pool *mem __attrib
repstr = lv_convert_lv_dup(mem, lv);
if (repstr)
- return dm_report_field_string(rh, field, &repstr);
+ return _string_disp(rh, mem, field, &repstr, private);
return _field_set_value(field, "", NULL);
}
@@ -2239,7 +2231,7 @@ static int _discards_disp(struct dm_report *rh, struct dm_pool *mem,
if (seg_is_thin_pool(seg)) {
discards_str = get_pool_discards_name(seg->discards);
- return dm_report_field_string(rh, field, &discards_str);
+ return _string_disp(rh, mem, field, &discards_str, private);
}
return _field_set_value(field, "", NULL);
@@ -2259,7 +2251,7 @@ static int _cachemode_disp(struct dm_report *rh, struct dm_pool *mem,
if (!(cachemode_str = get_cache_mode_name(seg)))
return_0;
- return dm_report_field_string(rh, field, &cachemode_str);
+ return _string_disp(rh, mem, field, &cachemode_str, private);
}
return _field_set_value(field, "", NULL);
@@ -2439,7 +2431,7 @@ static int _vgprofile_disp(struct dm_report *rh, struct dm_pool *mem,
const struct volume_group *vg = (const struct volume_group *) data;
if (vg->profile)
- return dm_report_field_string(rh, field, &vg->profile->name);
+ return _string_disp(rh, mem, field, &vg->profile->name, private);
return _field_set_value(field, "", NULL);
}
8 years, 3 months
master - report: fix invalid memory read when reporting cache LV policy name
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a83d611a86e6da...
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,
8 years, 3 months
v2_02_139 annotated tag has been created
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a52e23085dd84b...
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
8 years, 3 months
master - post-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0dac4f09b4fcf7...
Commit: 0dac4f09b4fcf752b039a80707653d3b655fc020
Parent: 04b82a81262c2da3b7254c884e6df46d59c69c4a
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Fri Jan 8 18:51:08 2016 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Fri Jan 8 18:51:08 2016 +0000
post-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 3 +++
WHATS_NEW_DM | 3 +++
4 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/VERSION b/VERSION
index 0275d39..37dcbe0 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.139(2)-git (2016-01-08)
+2.02.140(2)-git (2016-01-08)
diff --git a/VERSION_DM b/VERSION_DM
index a564059..43446ef 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.114-git (2016-01-08)
+1.02.115-git (2016-01-08)
diff --git a/WHATS_NEW b/WHATS_NEW
index d9e9775..15f835b 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,6 @@
+Version 2.02.140 -
+===================================
+
Version 2.02.139 - 8th January 2016
===================================
Update lvmlockd with the new VG seqno before devices are suspended.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 4ab492a..f9c808f 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,3 +1,6 @@
+Version 1.02.115 -
+=====================================
+
Version 1.02.114 - 14th December 2015
=====================================
Better support for dmsetup static linkage.
8 years, 3 months