master - fix segfault for invalid characters in vg name
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7cfbf3a394c2663fbee...
Commit: 7cfbf3a394c2663fbeed17705320b83e69781720
Parent: 5b3fbccab9e243901f512f9db3059a3c5eb09fe8
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Aug 29 11:35:46 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Aug 29 11:35:46 2019 -0500
fix segfault for invalid characters in vg name
Fixes a regression from commit ba7ff96faff0
"improve reading and repairing vg metadata"
where the error path for a vg name with invalid
charaters was missing an error flag, which led
to the caller not recognizing an error occured.
Previously, an error flag was hidden in the old
_vg_make_handle function.
---
lib/metadata/metadata.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 2c61bde..6d21ff9 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -4900,7 +4900,8 @@ struct volume_group *vg_read(struct cmd_context *cmd, const char *vg_name, const
if (!validate_name(vg_name)) {
log_error("Volume group name \"%s\" has invalid characters.", vg_name);
- return NULL;
+ failure |= FAILED_NOTFOUND;
+ goto_bad;
}
/*
4 years, 3 months
master - hints: check for malloc failure
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5b3fbccab9e243901f5...
Commit: 5b3fbccab9e243901f512f9db3059a3c5eb09fe8
Parent: 12707adac8ba9e3a58175616bcd59b0e229a6705
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Aug 28 12:39:50 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Aug 28 12:41:57 2019 -0500
hints: check for malloc failure
---
lib/label/hints.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/lib/label/hints.c b/lib/label/hints.c
index 580304d..6510fcf 100644
--- a/lib/label/hints.c
+++ b/lib/label/hints.c
@@ -608,7 +608,8 @@ static void _filter_to_str(struct cmd_context *cmd, int filter_cfg, char **strp)
return;
}
- str = malloc(len);
+ if (!(str = malloc(len)))
+ return;
memset(str, 0, len);
for (cv = cn->v; cv; cv = cv->next) {
4 years, 3 months
master - hints: fix copy of filter
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=12707adac8ba9e3a581...
Commit: 12707adac8ba9e3a58175616bcd59b0e229a6705
Parent: dcbed38b3339ce4da722bccec8eaf7b8d775a6c2
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Aug 28 12:33:04 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Aug 28 12:33:04 2019 -0500
hints: fix copy of filter
Only the first entry of the filter array was being
included in the copy of the filter, rather than the
entire thing. The result is that hints would not be
refreshed if the filter was changed but the first
entry was unchanged.
---
lib/label/hints.c | 79 +++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 68 insertions(+), 11 deletions(-)
diff --git a/lib/label/hints.c b/lib/label/hints.c
index 6de54bc..580304d 100644
--- a/lib/label/hints.c
+++ b/lib/label/hints.c
@@ -579,6 +579,52 @@ static void _apply_hints(struct cmd_context *cmd, struct dm_list *hints,
}
}
+static void _filter_to_str(struct cmd_context *cmd, int filter_cfg, char **strp)
+{
+ const struct dm_config_node *cn;
+ const struct dm_config_value *cv;
+ char *str;
+ int pos = 0;
+ int len = 0;
+ int ret;
+
+ *strp = NULL;
+
+ if (!(cn = find_config_tree_array(cmd, filter_cfg, NULL))) {
+ /* shouldn't happen because default is a|*| */
+ return;
+ }
+
+ for (cv = cn->v; cv; cv = cv->next) {
+ if (cv->type != DM_CFG_STRING)
+ continue;
+
+ len += (strlen(cv->v.str) + 1);
+ }
+ len++;
+
+ if (len == 1) {
+ /* shouldn't happen because default is a|*| */
+ return;
+ }
+
+ str = malloc(len);
+ memset(str, 0, len);
+
+ for (cv = cn->v; cv; cv = cv->next) {
+ if (cv->type != DM_CFG_STRING)
+ continue;
+
+ ret = snprintf(str + pos, len - pos, "%s", cv->v.str);
+
+ if (ret >= len - pos)
+ break;
+ pos += ret;
+ }
+
+ *strp = str;
+}
+
/*
* Return 1 and needs_refresh 0: the hints can be used
* Return 1 and needs_refresh 1: the hints can't be used and should be updated
@@ -590,12 +636,11 @@ static int _read_hint_file(struct cmd_context *cmd, struct dm_list *hints, int *
{
char devpath[PATH_MAX];
FILE *fp;
- const struct dm_config_node *cn;
struct dev_iter *iter;
struct hint *hint;
struct device *dev;
char *split[HINT_LINE_WORDS];
- char *name, *pvid, *devn, *vgname, *p;
+ char *name, *pvid, *devn, *vgname, *p, *filter_str = NULL;
uint32_t read_hash = 0;
uint32_t calc_hash = INITIAL_CRC;
uint32_t read_count = 0;
@@ -655,23 +700,31 @@ static int _read_hint_file(struct cmd_context *cmd, struct dm_list *hints, int *
keylen = strlen("global_filter:");
if (!strncmp(_hint_line, "global_filter:", keylen)) {
- cn = find_config_tree_array(cmd, devices_global_filter_CFG, NULL);
- if (strcmp(cn->v->v.str, _hint_line + keylen)) {
+ _filter_to_str(cmd, devices_global_filter_CFG, &filter_str);
+ if (!filter_str || strcmp(filter_str, _hint_line + keylen)) {
log_debug("ignore hints with different global_filter");
+ if (filter_str)
+ free(filter_str);
*needs_refresh = 1;
break;
}
+ if (filter_str)
+ free(filter_str);
continue;
}
keylen = strlen("filter:");
if (!strncmp(_hint_line, "filter:", keylen)) {
- cn = find_config_tree_array(cmd, devices_filter_CFG, NULL);
- if (strcmp(cn->v->v.str, _hint_line + keylen)) {
+ _filter_to_str(cmd, devices_filter_CFG, &filter_str);
+ if (!filter_str || strcmp(filter_str, _hint_line + keylen)) {
log_debug("ignore hints with different filter");
+ if (filter_str)
+ free(filter_str);
*needs_refresh = 1;
break;
}
+ if (filter_str)
+ free(filter_str);
continue;
}
@@ -800,11 +853,11 @@ int write_hint_file(struct cmd_context *cmd, int newhints)
{
char devpath[PATH_MAX];
FILE *fp;
- const struct dm_config_node *cn;
struct lvmcache_info *info;
struct dev_iter *iter;
struct device *dev;
const char *vgname;
+ char *filter_str = NULL;
uint32_t hash = INITIAL_CRC;
uint32_t count = 0;
time_t t;
@@ -855,11 +908,15 @@ int write_hint_file(struct cmd_context *cmd, int newhints)
fprintf(fp, "# Created by %s pid %d %s", cmd->name, getpid(), ctime(&t));
fprintf(fp, "hints_version: %d.%d\n", HINTS_VERSION_MAJOR, HINTS_VERSION_MINOR);
- cn = find_config_tree_array(cmd, devices_global_filter_CFG, NULL);
- fprintf(fp, "global_filter:%s\n", cn->v->v.str);
+ _filter_to_str(cmd, devices_global_filter_CFG, &filter_str);
+ fprintf(fp, "global_filter:%s\n", filter_str ?: "-");
+ if (filter_str)
+ free(filter_str);
- cn = find_config_tree_array(cmd, devices_filter_CFG, NULL);
- fprintf(fp, "filter:%s\n", cn->v->v.str);
+ _filter_to_str(cmd, devices_filter_CFG, &filter_str);
+ fprintf(fp, "filter:%s\n", filter_str ?: "-");
+ if (filter_str)
+ free(filter_str);
fprintf(fp, "scan_lvs:%d\n", cmd->scan_lvs);
4 years, 3 months
stable-2.02 - cov: Fix memory leak
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=402b41f58dc14160ec2...
Commit: 402b41f58dc14160ec21937d6308b0d9a1abba7d
Parent: 560dd9c552f49de0298104a69538b574f018fa40
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Wed Aug 28 10:45:04 2019 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Wed Aug 28 14:47:23 2019 +0200
cov: Fix memory leak
---
libdm/libdm-common.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c
index c300223..b06e678 100644
--- a/libdm/libdm-common.c
+++ b/libdm/libdm-common.c
@@ -2012,7 +2012,8 @@ static int _sysfs_get_kernel_name(uint32_t major, uint32_t minor, char *buf, siz
log_sys_error("readlink", sysfs_path);
else {
log_sys_debug("readlink", sysfs_path);
- return _sysfs_find_kernel_name(major, minor, buf, buf_size);
+ r = _sysfs_find_kernel_name(major, minor, buf, buf_size);
+ goto bad;
}
goto bad;
}
4 years, 3 months
master - fix duplicate pv size check
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=dcbed38b3339ce4da72...
Commit: dcbed38b3339ce4da722bccec8eaf7b8d775a6c2
Parent: 32a8865a272d31d5bc12332a4da0309ce3af9243
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Aug 27 15:40:24 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Aug 27 15:40:24 2019 -0500
fix duplicate pv size check
Fixes a segfault in the recent commit e01fddc57:
"improve duplicate pv handling for md components"
While choosing between duplicates, the info struct is
not always valid; it may have been dropped already.
Remove the code that was still using the info struct for
size comparisons. The size comparisons were a bogus check
anyway because it was just preferring the dev that had
already been chosen, it wasn't actually comparing the
dev size to the PV size. It would be good to use a
dev/PV size comparison in the duplicate handling code, but
the PV size is not available until after vg_read, not
from the scan.
---
lib/cache/lvmcache.c | 24 ------------------------
1 files changed, 0 insertions(+), 24 deletions(-)
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index 87c0021..29d6446 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -491,12 +491,10 @@ static void _choose_duplicates(struct cmd_context *cmd,
struct lvmcache_info *info;
struct device *dev1, *dev2;
uint32_t dev1_major, dev1_minor, dev2_major, dev2_minor;
- uint64_t info_size, dev1_size, dev2_size;
int in_subsys1, in_subsys2;
int is_dm1, is_dm2;
int has_fs1, has_fs2;
int has_lv1, has_lv2;
- int same_size1, same_size2;
int prev_unchosen1, prev_unchosen2;
int change;
@@ -613,11 +611,6 @@ next:
dev2_major = MAJOR(dev2->dev);
dev2_minor = MINOR(dev2->dev);
- if (!dev_get_size(dev1, &dev1_size))
- dev1_size = 0;
- if (!dev_get_size(dev2, &dev2_size))
- dev2_size = 0;
-
has_lv1 = (dev1->flags & DEV_USED_FOR_LV) ? 1 : 0;
has_lv2 = (dev2->flags & DEV_USED_FOR_LV) ? 1 : 0;
@@ -630,21 +623,11 @@ next:
has_fs1 = dm_device_has_mounted_fs(dev1_major, dev1_minor);
has_fs2 = dm_device_has_mounted_fs(dev2_major, dev2_minor);
- info_size = info->device_size >> SECTOR_SHIFT;
- same_size1 = (dev1_size == info_size);
- same_size2 = (dev2_size == info_size);
-
log_debug_cache("PV %s compare duplicates: %s %u:%u. %s %u:%u.",
devl->dev->pvid,
dev_name(dev1), dev1_major, dev1_minor,
dev_name(dev2), dev2_major, dev2_minor);
- log_debug_cache("PV %s: wants size %llu. %s is %llu. %s is %llu.",
- devl->dev->pvid,
- (unsigned long long)info_size,
- dev_name(dev1), (unsigned long long)dev1_size,
- dev_name(dev2), (unsigned long long)dev2_size);
-
log_debug_cache("PV %s: %s was prev %s. %s was prev %s.",
devl->dev->pvid,
dev_name(dev1), prev_unchosen1 ? "not chosen" : "<none>",
@@ -686,13 +669,6 @@ next:
/* change to 2 */
change = 1;
reason = "device is used by LV";
- } else if (same_size1 && !same_size2) {
- /* keep 1 */
- reason = "device size is correct";
- } else if (same_size2 && !same_size1) {
- /* change to 2 */
- change = 1;
- reason = "device size is correct";
} else if (has_fs1 && !has_fs2) {
/* keep 1 */
reason = "device has fs mounted";
4 years, 3 months
v2_02_186 annotated tag has been created
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a17661b9cdfc6b6d976...
Commit: a17661b9cdfc6b6d9762e7d42515f1b1c751e0ae
Parent: 0000000000000000000000000000000000000000
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: 2019-08-27 15:22 +0000
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: 2019-08-27 15:22 +0000
annotated tag: v2_02_186 has been created
at a17661b9cdfc6b6d9762e7d42515f1b1c751e0ae (tag)
tagging 4e5761487efcb33a47f8913f5302e36307604832 (commit)
replaces v2_02_185
Release 2.02.186
Bug fix release.
Notable changes:
Fix not working RAID repair.
Allow --stripes/--stripesize in 'mirror' conversions.
Disable incorrect linear to mirror of active LV in cluster VG.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
iQIcBAABAgAGBQJdZUzQAAoJELkRJDHlCQOfQa8P/1TM1oNoCkwkkWuSDVeSg8KT
axHyGJnxDqVivwasPRx3xvaP0NsRsc2mpZxB9NChfZdwkrF3+CF5fVsqSVLnGHxL
HCeHfOV5PjtsQAf+uUG6AS/fZllW1iRfeaMxXEqaa/DbRrspaJQtMj8JEVn7b0l9
Fi2R3nKeaNio8AHfxupZz9McZaBgF6QihqEOVgLl/gaOZ24RcyAvU1onIzyz3OnJ
8QMfiA3UHc1UwpP79nCcSbx8ndDMJxoxK/HuyVMNatNP18RZ0KQy6gMR92ViWjiQ
InEte1qj+3rzWskbk2zTPrBLUYAnx2UTyGbbWdwY+ub7Z4Dj5ZBq9kIIW/gHcCJF
ApUhR2IB6iCA8EsooLvVBzGW+SKMC5E+xt94uUzKEP+WClxqRamPZ7Z5vKHDuJNz
5Q9VZOHag/z4vzKyyOh874Gd4STec6rOi6DIBVgXhxMjDqZUm7hRrr/4io56pToH
nNLrOr9JQF9rwgxWQHXjkcWZpEPHHzhAc4NSyXIscegzS1F+KODUHlkCJpRWHRTD
mZODtB648uUK9XKyYGbnMXSRBJnAf2rq8XDpyzvOvETBx73r5dpTlBb5UlOb9GGm
OzlonVwXiFcB3Ru/WnRqUBHqShe7aqfGt8Hay4rwLwlfH7FhyqeuDDFf8H6ZEo8k
tOHO9oY1QcJWSSQjGnFx
=uehd
-----END PGP SIGNATURE-----
David Teigland (15):
lvmlockd: do not allow mirror LV to be activated shared
man: updates to lvmlockd
lvmcache: remove unused_duplicate_devs list from cmd
lvconvert: disable linear to mirror of active LV in cluster VG
Revert "lvconvert: disable linear to mirror of active LV in cluster VG"
pvremove/vgextend: fix using device aliases with lvmetad
tests: fsadm-crypt.sh update mkfs parameter
vgrename: use global lock
Fix rounding writes up to sector size
tests: large-physical-sector-size
WHATS_NEW: fix large physical block size
vgchange: don't fail monitor command if vg is exported
man lvmthin: remove nonexistent topic
devices: put ifdef around BLKPBSZGET
pvscan: avoid redundant activation
Heinz Mauelshagen (4):
lvconvert: allow --stripes/--stripesize in 'mirror' conversions
pvmove_poll: instrument
dmeventd: avoid bail out preventing repair in raid plugin
Revert "pvmove_poll: instrument"
Marian Csontos (5):
post-release
build: Fix make rpm with releases
cov: Fix a leak
build: make generate
pre-release
Peter Rajnoha (1):
udev: do not overwrite ID_MODEL in 69-dm-lvm-metad.rules
Zdenek Kabelac (49):
tests: update cache test
cache: support no_discard_passdown
tests: automatically set scan_lvs when using extend_filter
tests: check no_discard_passdown
mirror: fix monitoring change
tests: replaces grep -q usage
tests: fix ra checking
tests: check mirror with clvmd and dmeventd
aux: fix selecting lvmconf values
tests: simplify some var settings
tests: update resize value
tests: check for installed time command
tests: for cluster testing we always need exclusive mirrors
tests: drop unwanted backup
tests: properly enforce v1
tests: accept also value 512
tests: for cluster always use exlusive mirrors
cov: unlock lvm2 mutex on error path
cov: release iterator on error path
cov: check result of dev_read_bytes
cov: check result of dev_get_block_size
cov: check lv_info
cov: check for socket_path being set
cov: add stack tracing for error paths
cov: clearer condition check
cov: validate pagesize is not negative
cov: ensure cname exists before derefering it
cov: remove unused headers
libdm: implement search for device names for older kernels
gcc: cleanup warning of shawhing a global dclr
gcc: clean uninitialized var warning
cov: release iterator on error path
cov: avoid recursive self-inclusion
tests: raise minsize of xfs
tests: use luks1 for test
tests: split args
tests: add settle wait before issue remove
make: support comments in exported symbols
exported_symbols: comment old symbols
pvmove: correcting read_ahead setting
pvmove: add missing synchronization
activation: add synchronization point
dmsetup: debug print
activation: extend handling of pending_delete
snapshot: always activate
cache: improve vgremove loop
lv_manip: add synchronizations
dmsetup: missed trailing newline
activation: use cmd pending mem for pending_delete
4 years, 3 months
stable-2.02 - post-release
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=560dd9c552f49de0298...
Commit: 560dd9c552f49de0298104a69538b574f018fa40
Parent: 4e5761487efcb33a47f8913f5302e36307604832
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Tue Aug 27 17:21:22 2019 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Tue Aug 27 17:21:22 2019 +0200
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 7f0e456..f4c4e68 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.186(2) (2019-08-27)
+2.02.187(2)-git (2019-08-27)
diff --git a/VERSION_DM b/VERSION_DM
index 864ceb8..bd0598a 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.164 (2019-08-27)
+1.02.166-git (2019-08-27)
diff --git a/WHATS_NEW b/WHATS_NEW
index cf2ec3e..afdf523 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,6 @@
+Version 2.02.187 -
+===================================
+
Version 2.02.186 - 27th August 2019
===================================
Improve internal removal of cached devices.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 5c2a436..576ad38 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,3 +1,6 @@
+Version 1.02.166 -
+===================================
+
Version 1.02.164 - 27th August 2019
===================================
Add debug of dmsetup udevcomplete with hexa print DM_COOKIE_COMPLETED.
4 years, 3 months
stable-2.02 - pre-release
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=4e5761487efcb33a47f...
Commit: 4e5761487efcb33a47f8913f5302e36307604832
Parent: 3954034b1577c21be18acd2f8e1904c3181c6c19
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Tue Aug 27 17:20:17 2019 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Tue Aug 27 17:20:17 2019 +0200
pre-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 4 ++--
WHATS_NEW_DM | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/VERSION b/VERSION
index f68edcf..7f0e456 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.186(2)-git (2019-05-13)
+2.02.186(2) (2019-08-27)
diff --git a/VERSION_DM b/VERSION_DM
index 88c14ba..864ceb8 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.160-git (2019-05-13)
+1.02.164 (2019-08-27)
diff --git a/WHATS_NEW b/WHATS_NEW
index fa631ec..cf2ec3e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,5 @@
-Version 2.02.186 -
-================================
+Version 2.02.186 - 27th August 2019
+===================================
Improve internal removal of cached devices.
Synchronize with udev when dropping snapshot.
Add missing device synchronization point before removing pvmove node.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 1dc18ec..5c2a436 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,5 @@
-Version 1.02.165 -
-=================================
+Version 1.02.164 - 27th August 2019
+===================================
Add debug of dmsetup udevcomplete with hexa print DM_COOKIE_COMPLETED.
Fix versioning of dm_stats_create_region and dm_stats_create_region.
Parsing of cache status understand no_discard_passdown.
4 years, 3 months
stable-2.02 - build: make generate
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3954034b1577c21be18...
Commit: 3954034b1577c21be18acd2f8e1904c3181c6c19
Parent: ad86cda4d79704dcce13d98cd9579baab56b7e7b
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Tue Aug 27 17:10:05 2019 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Tue Aug 27 17:10:52 2019 +0200
build: make generate
---
man/lvconvert.8_pregen | 70 ++++++++++++++++++++++++++----------------------
1 files changed, 38 insertions(+), 32 deletions(-)
diff --git a/man/lvconvert.8_pregen b/man/lvconvert.8_pregen
index a47127b..e6de8f0 100644
--- a/man/lvconvert.8_pregen
+++ b/man/lvconvert.8_pregen
@@ -354,6 +354,44 @@ Convert LV to striped.
.RE
-
+Convert LV to type mirror (also see type raid1),
+.br
+.P
+\fBlvconvert\fP \fB--type\fP \fBmirror\fP \fILV\fP
+.br
+.RS 4
+.ad l
+[ \fB-m\fP|\fB--mirrors\fP [\fB+\fP|\fB-\fP]\fINumber\fP ]
+.ad b
+.br
+.ad l
+[ \fB-I\fP|\fB--stripesize\fP \fISize\fP[k|UNIT] ]
+.ad b
+.br
+.ad l
+[ \fB-R\fP|\fB--regionsize\fP \fISize\fP[m|UNIT] ]
+.ad b
+.br
+.ad l
+[ \fB-i\fP|\fB--interval\fP \fINumber\fP ]
+.ad b
+.br
+.ad l
+[ \fB--stripes\fP \fINumber\fP ]
+.ad b
+.br
+.ad l
+[ \fB--mirrorlog\fP \fBcore\fP|\fBdisk\fP ]
+.ad b
+.br
+[ COMMON_OPTIONS ]
+.RE
+.br
+.RS 4
+[ \fIPV\fP ... ]
+.RE
+-
+
Convert LV to raid or change raid layout
.br
(a specific raid level must be used, e.g. raid1).
@@ -1472,38 +1510,6 @@ For example, LVM_VG_NAME can generally be substituted for a required VG paramete
.SH ADVANCED USAGE
Alternate command forms, advanced command usage, and listing of all valid syntax for completeness.
.P
-Convert LV to type mirror (also see type raid1),
-.br
-(also see lvconvert --mirrors).
-.br
-.P
-\fBlvconvert\fP \fB--type\fP \fBmirror\fP \fILV\fP
-.br
-.RS 4
-.ad l
-[ \fB-m\fP|\fB--mirrors\fP [\fB+\fP|\fB-\fP]\fINumber\fP ]
-.ad b
-.br
-.ad l
-[ \fB-R\fP|\fB--regionsize\fP \fISize\fP[m|UNIT] ]
-.ad b
-.br
-.ad l
-[ \fB-i\fP|\fB--interval\fP \fINumber\fP ]
-.ad b
-.br
-.ad l
-[ \fB--mirrorlog\fP \fBcore\fP|\fBdisk\fP ]
-.ad b
-.br
-[ COMMON_OPTIONS ]
-.RE
-.br
-.RS 4
-[ \fIPV\fP ... ]
-.RE
--
-
Change the region size of an LV.
.br
.P
4 years, 3 months
master - Fix converting dbus.UInt types to string
by Tony Asleson
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=32a8865a272d31d5bc1...
Commit: 32a8865a272d31d5bc12332a4da0309ce3af9243
Parent: b2885b7103049b11ca3e98fe0c8898df2ce5f9ac
Author: Vojtech Trefny <vtrefny(a)redhat.com>
AuthorDate: Mon Aug 26 14:35:51 2019 +0200
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Tue Aug 27 09:43:43 2019 -0500
Fix converting dbus.UInt types to string
With Python 3.8 converting these directly to string using str()
no longer works, we need to convert these to integer first.
On Python 3.8:
>>> str(dbus.Int64(1))
'dbus.Int64(1)'
On Python 3.7 (and older):
>>> str(dbus.UInt64(1))
'1'
This is probably related to removing __str__ function from method
from int (dbus.UInt is subclass of int) which happened in 3.8, see
https://docs.python.org/3.8/whatsnew/3.8.html
Signed-off-by: Vojtech Trefny <vtrefny(a)redhat.com>
---
daemons/lvmdbusd/cmdhandler.py | 35 +++++++++++++++++++----------------
1 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/daemons/lvmdbusd/cmdhandler.py b/daemons/lvmdbusd/cmdhandler.py
index df854eb..f7f6acd 100644
--- a/daemons/lvmdbusd/cmdhandler.py
+++ b/daemons/lvmdbusd/cmdhandler.py
@@ -217,7 +217,10 @@ def options_to_cli_args(options):
else:
rc.append("--%s" % k)
if v != "":
- rc.append(str(v))
+ if isinstance(v, int):
+ rc.append(str(int(v)))
+ else:
+ rc.append(str(v))
return rc
@@ -280,7 +283,7 @@ def vg_remove(vg_name, remove_options):
def vg_lv_create(vg_name, create_options, name, size_bytes, pv_dests):
cmd = ['lvcreate']
cmd.extend(options_to_cli_args(create_options))
- cmd.extend(['--size', str(size_bytes) + 'B'])
+ cmd.extend(['--size', '%dB' % size_bytes])
cmd.extend(['--name', name, vg_name, '--yes'])
pv_dest_ranges(cmd, pv_dests)
return call(cmd)
@@ -292,7 +295,7 @@ def vg_lv_snapshot(vg_name, snapshot_options, name, size_bytes):
cmd.extend(["-s"])
if size_bytes != 0:
- cmd.extend(['--size', str(size_bytes) + 'B'])
+ cmd.extend(['--size', '%dB' % size_bytes])
cmd.extend(['--name', name, vg_name])
return call(cmd)
@@ -303,9 +306,9 @@ def _vg_lv_create_common_cmd(create_options, size_bytes, thin_pool):
cmd.extend(options_to_cli_args(create_options))
if not thin_pool:
- cmd.extend(['--size', str(size_bytes) + 'B'])
+ cmd.extend(['--size', '%dB' % size_bytes])
else:
- cmd.extend(['--thin', '--size', str(size_bytes) + 'B'])
+ cmd.extend(['--thin', '--size', '%dB' % size_bytes])
cmd.extend(['--yes'])
return cmd
@@ -320,10 +323,10 @@ def vg_lv_create_linear(vg_name, create_options, name, size_bytes, thin_pool):
def vg_lv_create_striped(vg_name, create_options, name, size_bytes,
num_stripes, stripe_size_kb, thin_pool):
cmd = _vg_lv_create_common_cmd(create_options, size_bytes, thin_pool)
- cmd.extend(['--stripes', str(num_stripes)])
+ cmd.extend(['--stripes', str(int(num_stripes))])
if stripe_size_kb != 0:
- cmd.extend(['--stripesize', str(stripe_size_kb)])
+ cmd.extend(['--stripesize', str(int(stripe_size_kb))])
cmd.extend(['--name', name, vg_name])
return call(cmd)
@@ -336,13 +339,13 @@ def _vg_lv_create_raid(vg_name, create_options, name, raid_type, size_bytes,
cmd.extend(options_to_cli_args(create_options))
cmd.extend(['--type', raid_type])
- cmd.extend(['--size', str(size_bytes) + 'B'])
+ cmd.extend(['--size', '%dB' % size_bytes])
if num_stripes != 0:
- cmd.extend(['--stripes', str(num_stripes)])
+ cmd.extend(['--stripes', str(int(num_stripes))])
if stripe_size_kb != 0:
- cmd.extend(['--stripesize', str(stripe_size_kb)])
+ cmd.extend(['--stripesize', str(int(stripe_size_kb))])
cmd.extend(['--name', name, vg_name, '--yes'])
return call(cmd)
@@ -363,8 +366,8 @@ def vg_lv_create_mirror(
cmd.extend(options_to_cli_args(create_options))
cmd.extend(['--type', 'mirror'])
- cmd.extend(['--mirrors', str(num_copies)])
- cmd.extend(['--size', str(size_bytes) + 'B'])
+ cmd.extend(['--mirrors', str(int(num_copies))])
+ cmd.extend(['--size', '%dB' % size_bytes])
cmd.extend(['--name', name, vg_name, '--yes'])
return call(cmd)
@@ -418,7 +421,7 @@ def lv_resize(lv_full_name, size_change, pv_dests,
def lv_lv_create(lv_full_name, create_options, name, size_bytes):
cmd = ['lvcreate']
cmd.extend(options_to_cli_args(create_options))
- cmd.extend(['--virtualsize', str(size_bytes) + 'B', '-T'])
+ cmd.extend(['--virtualsize', '%dB' % size_bytes, '-T'])
cmd.extend(['--name', name, lv_full_name, '--yes'])
return call(cmd)
@@ -556,7 +559,7 @@ def pv_resize(device, size_bytes, create_options):
cmd.extend(options_to_cli_args(create_options))
if size_bytes != 0:
- cmd.extend(['--yes', '--setphysicalvolumesize', str(size_bytes) + 'B'])
+ cmd.extend(['--yes', '--setphysicalvolumesize', '%dB' % size_bytes])
cmd.extend([device])
return call(cmd)
@@ -652,12 +655,12 @@ def vg_allocation_policy(vg_name, policy, policy_options):
def vg_max_pv(vg_name, number, max_options):
- return _vg_value_set(vg_name, ['--maxphysicalvolumes', str(number)],
+ return _vg_value_set(vg_name, ['--maxphysicalvolumes', str(int(number))],
max_options)
def vg_max_lv(vg_name, number, max_options):
- return _vg_value_set(vg_name, ['-l', str(number)], max_options)
+ return _vg_value_set(vg_name, ['-l', str(int(number))], max_options)
def vg_uuid_gen(vg_name, ignore, options):
4 years, 3 months