stable-2.02 - pre-release
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3aeff09bd7db18e4cb8...
Commit: 3aeff09bd7db18e4cb83c44b52eae0acac755201
Parent: d5a5792b30c74b9b4d839b5a33c466c2ac012d0c
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Mon May 13 09:45:25 2019 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Mon May 13 09:51:28 2019 +0200
pre-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 6 +++---
WHATS_NEW_DM | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/VERSION b/VERSION
index b6970e5..583267e 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.185(2)-git (2019-03-22)
+2.02.185(2) (2019-05-13)
diff --git a/VERSION_DM b/VERSION_DM
index 57cbc8d..8c4af2c 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.158-git (2019-03-22)
+1.02.158 (2019-05-13)
diff --git a/WHATS_NEW b/WHATS_NEW
index 4b7be7c..4e75c6a 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,9 +1,9 @@
-Version 2.02.185 -
-==================================
+Version 2.02.185 - 13th May 2019
+================================
Fix change of monitoring in clustered volumes.
Improve -lXXX%VG modifier which improves cache segment estimation.
Add synchronization with udev before removing cached devices.
- Fix missing growth of _pmsmare volume when extending _tmeta volume.
+ Fix missing growth of _pmspare volume when extending _tmeta volume.
Automatically grow thin metadata, when thin data gets too big.
Add support for vgsplit with cached devices.
Fix signal delivery checking race in libdaemon (lvmetad).
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 8258273..7c74bfe 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,5 @@
-Version 1.02.158 -
-==================================
+Version 1.02.158 - 13th May 2019
+================================
Version 1.02.156 - 22nd March 2019
==================================
4 years, 11 months
master - tests: check accepting out-of-range creation_time
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=0c26aa13ca588fc552a...
Commit: 0c26aa13ca588fc552a2748aee5654866ce7cced
Parent: 85dbcda1503eef81be11947be8b9abb0b8c41c9c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri May 10 15:00:21 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri May 10 15:00:21 2019 +0200
tests: check accepting out-of-range creation_time
---
test/shell/creation-time.sh | 40 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/test/shell/creation-time.sh b/test/shell/creation-time.sh
new file mode 100644
index 0000000..2a4a387
--- /dev/null
+++ b/test/shell/creation-time.sh
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2019 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# Check we can read metadata with out-of-range creation time
+
+# Due to a bug in 32-bit version lvm2 <2.02.169 produced metadata
+# contained invalid number for creation_time
+
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+aux prepare_vg 1
+
+lvcreate -an -L1 -n $lv1 $vg
+
+vgcfgbackup -f back $vg
+
+sed -e 's/creation_time = \(.*\)$/creation_time = 12029933779523993599/g' back >backnew
+
+vgcfgrestore -f backnew $vg |& tee err
+
+# Check the time was spotted
+grep Invalid err
+
+vgcfgbackup -f back $vg |& tee err
+
+# Check the time is not a problem anymore
+not grep Invalid err
+
+vgremove -ff $vg
4 years, 11 months
master - metadata: allow reading metadata with invalid creation_time
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=85dbcda1503eef81be1...
Commit: 85dbcda1503eef81be11947be8b9abb0b8c41c9c
Parent: 1f7c9da554fdb9069bc46e973678e055a491ea1d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri May 10 14:40:11 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri May 10 14:40:11 2019 +0200
metadata: allow reading metadata with invalid creation_time
lvm2 till version 2.02.169 (commit 78d004efa8a1809cea68283e6204edfa9d7c1091)
was printing invalid creation_time argument into metadata on 32bit arch.
However with commit ba9820b14223b731125c83dbc9709aa44fdcdbf1 we started
to properly validate all input numbers and thus we refused to accept
invalid metadata with 'garbage' string - but this results in the
situation where metadata produced on older lvm2 on 32 bit architecture
will become unreadable after upgrade.
To fix this case - extend libdm parser in a way, that whenever we
find error integer value, we also check if the parsed value is not for
creation_time node and in this case we let the metadata pass through
with made-up date 2018-05-24 (release date of 2.02.169).
---
device_mapper/libdm-config.c | 18 +++++++++++++++---
libdm/libdm-config.c | 18 +++++++++++++++---
2 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/device_mapper/libdm-config.c b/device_mapper/libdm-config.c
index 0928843..d2ac43c 100644
--- a/device_mapper/libdm-config.c
+++ b/device_mapper/libdm-config.c
@@ -51,6 +51,8 @@ struct parser {
struct dm_pool *mem;
int no_dup_node_check; /* whether to disable dup node checking */
+ const char *key; /* last obtained key */
+ unsigned ignored_creation_time;
};
struct config_output {
@@ -176,7 +178,7 @@ static int _do_dm_config_parse(struct dm_config_tree *cft, const char *start, co
/* TODO? if (start == end) return 1; */
struct parser *p;
- if (!(p = dm_pool_alloc(cft->mem, sizeof(*p))))
+ if (!(p = dm_pool_zalloc(cft->mem, sizeof(*p))))
return_0;
p->mem = cft->mem;
@@ -615,6 +617,7 @@ static struct dm_config_node *_section(struct parser *p, struct dm_config_node *
match(TOK_SECTION_E);
} else {
match(TOK_EQ);
+ p->key = root->key;
if (!(value = _value(p)))
return_NULL;
if (root->v)
@@ -682,8 +685,17 @@ static struct dm_config_value *_type(struct parser *p)
errno = 0;
v->v.i = strtoll(p->tb, NULL, 0); /* FIXME: check error */
if (errno) {
- log_error("Failed to read int token.");
- return NULL;
+ if (errno == ERANGE && p->key &&
+ strcmp("creation_time", p->key) == 0) {
+ /* Due to a bug in some older 32bit builds (<2.02.169),
+ * lvm was able to produce invalid creation_time string */
+ v->v.i = 1527120000; /* Pick 2018-05-24 day instead */
+ if (!p->ignored_creation_time++)
+ log_warn("WARNING: Invalid creation_time found in metadata (repaired with next metadata update).");
+ } else {
+ log_error("Failed to read int token.");
+ return NULL;
+ }
}
match(TOK_INT);
break;
diff --git a/libdm/libdm-config.c b/libdm/libdm-config.c
index 3666fc9..6edeee2 100644
--- a/libdm/libdm-config.c
+++ b/libdm/libdm-config.c
@@ -51,6 +51,8 @@ struct parser {
struct dm_pool *mem;
int no_dup_node_check; /* whether to disable dup node checking */
+ const char *key; /* last obtained key */
+ unsigned ignored_creation_time;
};
struct config_output {
@@ -176,7 +178,7 @@ static int _do_dm_config_parse(struct dm_config_tree *cft, const char *start, co
/* TODO? if (start == end) return 1; */
struct parser *p;
- if (!(p = dm_pool_alloc(cft->mem, sizeof(*p))))
+ if (!(p = dm_pool_zalloc(cft->mem, sizeof(*p))))
return_0;
p->mem = cft->mem;
@@ -615,6 +617,7 @@ static struct dm_config_node *_section(struct parser *p, struct dm_config_node *
match(TOK_SECTION_E);
} else {
match(TOK_EQ);
+ p->key = root->key;
if (!(value = _value(p)))
return_NULL;
if (root->v)
@@ -682,8 +685,17 @@ static struct dm_config_value *_type(struct parser *p)
errno = 0;
v->v.i = strtoll(p->tb, NULL, 0); /* FIXME: check error */
if (errno) {
- log_error("Failed to read int token.");
- return NULL;
+ if (errno == ERANGE && p->key &&
+ strcmp("creation_time", p->key) == 0) {
+ /* Due to a bug in some older 32bit builds (<2.02.169),
+ * lvm was able to produce invalid creation_time string */
+ v->v.i = 1527120000; /* Pick 2018-05-24 day instead */
+ if (!p->ignored_creation_time++)
+ log_warn("WARNING: Invalid creation_time found in metadata (repaired with next metadata update).");
+ } else {
+ log_error("Failed to read int token.");
+ return NULL;
+ }
}
match(TOK_INT);
break;
4 years, 11 months
stable-2.02 - tests: check accepting out-of-range creation_time
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d5a5792b30c74b9b4d8...
Commit: d5a5792b30c74b9b4d839b5a33c466c2ac012d0c
Parent: a397b69ce33d811aba7d64d54b5c8e0efb86fd15
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri May 10 15:00:21 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri May 10 15:07:25 2019 +0200
tests: check accepting out-of-range creation_time
---
test/shell/creation-time.sh | 40 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/test/shell/creation-time.sh b/test/shell/creation-time.sh
new file mode 100644
index 0000000..2a4a387
--- /dev/null
+++ b/test/shell/creation-time.sh
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2019 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# Check we can read metadata with out-of-range creation time
+
+# Due to a bug in 32-bit version lvm2 <2.02.169 produced metadata
+# contained invalid number for creation_time
+
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+aux prepare_vg 1
+
+lvcreate -an -L1 -n $lv1 $vg
+
+vgcfgbackup -f back $vg
+
+sed -e 's/creation_time = \(.*\)$/creation_time = 12029933779523993599/g' back >backnew
+
+vgcfgrestore -f backnew $vg |& tee err
+
+# Check the time was spotted
+grep Invalid err
+
+vgcfgbackup -f back $vg |& tee err
+
+# Check the time is not a problem anymore
+not grep Invalid err
+
+vgremove -ff $vg
4 years, 11 months
stable-2.02 - metadata: allow reading metadata with invalid creation_time
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a397b69ce33d811aba7...
Commit: a397b69ce33d811aba7d64d54b5c8e0efb86fd15
Parent: a8921be641afe865c177e11b8859f4b937f76995
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri May 10 14:40:11 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri May 10 15:07:15 2019 +0200
metadata: allow reading metadata with invalid creation_time
lvm2 till version 2.02.169 (commit 78d004efa8a1809cea68283e6204edfa9d7c1091)
was printing invalid creation_time argument into metadata on 32bit arch.
However with commit ba9820b14223b731125c83dbc9709aa44fdcdbf1 we started
to properly validate all input numbers and thus we refused to accept
invalid metadata with 'garbage' string - but this results in the
situation where metadata produced on older lvm2 on 32 bit architecture
will become unreadable after upgrade.
To fix this case - extend libdm parser in a way, that whenever we
find error integer value, we also check if the parsed value is not for
creation_time node and in this case we let the metadata pass through
with made-up date 2018-05-24 (release date of 2.02.169).
---
libdm/libdm-config.c | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/libdm/libdm-config.c b/libdm/libdm-config.c
index 3f0d251..382f86b 100644
--- a/libdm/libdm-config.c
+++ b/libdm/libdm-config.c
@@ -51,6 +51,8 @@ struct parser {
struct dm_pool *mem;
int no_dup_node_check; /* whether to disable dup node checking */
+ const char *key; /* last obtained key */
+ unsigned ignored_creation_time;
};
struct config_output {
@@ -176,7 +178,7 @@ static int _do_dm_config_parse(struct dm_config_tree *cft, const char *start, co
/* TODO? if (start == end) return 1; */
struct parser *p;
- if (!(p = dm_pool_alloc(cft->mem, sizeof(*p))))
+ if (!(p = dm_pool_zalloc(cft->mem, sizeof(*p))))
return_0;
p->mem = cft->mem;
@@ -615,6 +617,7 @@ static struct dm_config_node *_section(struct parser *p, struct dm_config_node *
match(TOK_SECTION_E);
} else {
match(TOK_EQ);
+ p->key = root->key;
if (!(value = _value(p)))
return_NULL;
if (root->v)
@@ -682,8 +685,17 @@ static struct dm_config_value *_type(struct parser *p)
errno = 0;
v->v.i = strtoll(p->tb, NULL, 0); /* FIXME: check error */
if (errno) {
- log_error("Failed to read int token.");
- return NULL;
+ if (errno == ERANGE && p->key &&
+ strcmp("creation_time", p->key) == 0) {
+ /* Due to a bug in some older 32bit builds (<2.02.169),
+ * lvm was able to produce invalid creation_time string */
+ v->v.i = 1527120000; /* Pick 2018-05-24 day instead */
+ if (!p->ignored_creation_time++)
+ log_warn("WARNING: Invalid creation_time found in metadata (repaired with next metadata update).");
+ } else {
+ log_error("Failed to read int token.");
+ return NULL;
+ }
}
match(TOK_INT);
break;
4 years, 11 months
stable-2.02 - monitoring: fix monitoring change for cluster
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a8921be641afe865c17...
Commit: a8921be641afe865c177e11b8859f4b937f76995
Parent: 9d7afaaab85404a562942f4662de8a2e7739d8fb
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Oct 10 14:38:21 2018 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon May 6 15:57:52 2019 +0200
monitoring: fix monitoring change for cluster
Fix bug in table reload for clustered VG.
Function used in lv/vgchange --monitor y|n is using 'somewhat' hackish
shortcut and accesses activation function monitor_dev_for_events()
directly rather through full device refresh to avoid table reload
in case user want to only change monitoring state of device.
However since with old 'mirrors' there is table change dropping
handle_error there was in some cases needed table update.
This was put into monitor_dev_for_events() with assumption
vg_write_lock_held() could be used to decide if the actual monitoring
change comes from read-only lock-holding commands lvchange/vgchange.
However the clustered locking part (clvmd) actually doesn't differentiate
about this concept of having VG openned in read-only or write mode.
So it caused unwanted reloads of mirror tables even in commands like lvconvert.
Thus for clustered locking there is full table reload put into the code and
shortcut applies only for non-clustered locking.
Also the patch tries to avoid calling repeated LV refresh in case the
lv/vgchange uses --refresh & --monitor.
---
WHATS_NEW | 1 +
lib/activate/activate.c | 4 ++--
tools/lvchange.c | 28 +++++++++++++++++++---------
tools/vgchange.c | 15 +++++++++++++--
4 files changed, 35 insertions(+), 13 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 4b73ccc..4b7be7c 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.185 -
==================================
+ Fix change of monitoring in clustered volumes.
Improve -lXXX%VG modifier which improves cache segment estimation.
Add synchronization with udev before removing cached devices.
Fix missing growth of _pmsmare volume when extending _tmeta volume.
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 4c83231..dc9bc9e 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -2048,12 +2048,12 @@ int monitor_dev_for_events(struct cmd_context *cmd, const struct logical_volume
} else
continue;
- if (!vg_write_lock_held() && lv_is_mirror(lv)) {
- mirr_laopts.exclusive = lv_is_active_exclusive_locally(lv) ? 1 : 0;
+ if (!locking_is_clustered() && !vg_write_lock_held() && lv_is_mirror(lv)) {
/*
* Commands vgchange and lvchange do use read-only lock when changing
* monitoring (--monitor y|n). All other use cases hold 'write-lock'
* so they skip this dm mirror table refreshing step.
+ * Shortcut can't be applied with clustered locking.
*/
if (!_lv_activate_lv(lv, &mirr_laopts)) {
stack;
diff --git a/tools/lvchange.c b/tools/lvchange.c
index 4195a80..7d0ec8f 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -148,7 +148,8 @@ static int _lvchange_pool_update(struct cmd_context *cmd,
*/
static int _lvchange_monitoring(struct cmd_context *cmd,
- struct logical_volume *lv)
+ struct logical_volume *lv,
+ int was_refreshed)
{
struct lvinfo info;
@@ -163,8 +164,15 @@ static int _lvchange_monitoring(struct cmd_context *cmd,
log_verbose("Monitoring LV %s", display_lvname(lv));
else
log_verbose("Unmonitoring LV %s", display_lvname(lv));
- if (!monitor_dev_for_events(cmd, lv, 0, dmeventd_monitor_mode()))
- return_0;
+
+ if (!was_refreshed) {
+ if (locking_is_clustered()) {
+ /* FIXME: doesn't work when the LV is not lockholder */
+ if ((lv == lv_lock_holder(lv)) && !lv_refresh(cmd, lv))
+ return_0;
+ } else if (!monitor_dev_for_events(cmd, lv, 0, dmeventd_monitor_mode()))
+ return_0;
+ }
}
return 1;
@@ -176,7 +184,8 @@ static int _lvchange_monitoring(struct cmd_context *cmd,
*/
static int _lvchange_background_polling(struct cmd_context *cmd,
- struct logical_volume *lv)
+ struct logical_volume *lv,
+ int was_refreshed)
{
struct lvinfo info;
@@ -187,7 +196,8 @@ static int _lvchange_background_polling(struct cmd_context *cmd,
if (background_polling()) {
log_verbose("Polling LV %s", display_lvname(lv));
- lv_spawn_background_polling(cmd, lv);
+ if (!was_refreshed)
+ lv_spawn_background_polling(cmd, lv);
}
return 1;
@@ -1422,11 +1432,11 @@ static int _lvchange_refresh_single(struct cmd_context *cmd,
* checking poll arg. Pull that out of lv_refresh.
*/
if (arg_is_set(cmd, poll_ARG) &&
- !_lvchange_background_polling(cmd, lv))
+ !_lvchange_background_polling(cmd, lv, 1))
return_ECMD_FAILED;
if (arg_is_set(cmd, monitor_ARG) &&
- !_lvchange_monitoring(cmd, lv))
+ !_lvchange_monitoring(cmd, lv, 1))
return_ECMD_FAILED;
return ECMD_PROCESSED;
@@ -1584,11 +1594,11 @@ static int _lvchange_monitor_poll_single(struct cmd_context *cmd,
struct processing_handle *handle)
{
if (arg_is_set(cmd, monitor_ARG) &&
- !_lvchange_monitoring(cmd, lv))
+ !_lvchange_monitoring(cmd, lv, 0))
return_ECMD_FAILED;
if (arg_is_set(cmd, poll_ARG) &&
- !_lvchange_background_polling(cmd, lv))
+ !_lvchange_background_polling(cmd, lv, 0))
return_ECMD_FAILED;
return ECMD_PROCESSED;
diff --git a/tools/vgchange.c b/tools/vgchange.c
index b2c739c..24c2253 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -42,7 +42,16 @@ static int _monitor_lvs_in_vg(struct cmd_context *cmd,
if (lv_is_pvmove(lv))
continue;
- if (!monitor_dev_for_events(cmd, lv, 0, reg)) {
+ if (locking_is_clustered()) {
+ if (lv != lv_lock_holder(lv))
+ continue;
+ if (!lv_refresh(cmd, lv)) {
+ stack;
+ r = 0;
+ continue;
+ }
+ } else if (!monitor_dev_for_events(cmd, lv, 0, reg)) {
+ stack;
r = 0;
continue;
}
@@ -157,8 +166,10 @@ static int _vgchange_monitoring(struct cmd_context *cmd, struct volume_group *vg
if (lvs_in_vg_activated(vg) &&
dmeventd_monitor_mode() != DMEVENTD_MONITOR_IGNORE) {
- if (!_monitor_lvs_in_vg(cmd, vg, dmeventd_monitor_mode(), &monitored))
+ if (!_monitor_lvs_in_vg(cmd, vg, dmeventd_monitor_mode(), &monitored)) {
+ stack;
r = 0;
+ }
log_print_unless_silent("%d logical volume(s) in volume group "
"\"%s\" %smonitored",
monitored, vg->name, (dmeventd_monitor_mode()) ? "" : "un");
4 years, 11 months
master - tests: split args
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1f7c9da554fdb9069bc...
Commit: 1f7c9da554fdb9069bc46e973678e055a491ea1d
Parent: 4ff472b9071e2a6efef96e425cbe38cc63280189
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon May 6 13:02:45 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon May 6 13:02:45 2019 +0200
tests: split args
Here we want args to be splited into individual strings.
---
test/shell/fsadm-crypt.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/shell/fsadm-crypt.sh b/test/shell/fsadm-crypt.sh
index 9c85edf..68fed95 100644
--- a/test/shell/fsadm-crypt.sh
+++ b/test/shell/fsadm-crypt.sh
@@ -137,7 +137,7 @@ get_crypt_kname() {
# $1 device
# $2 pass
crypt_format() {
- echo "$2" | cryptsetup luksFormat "$FORMAT_PARAMS" "$1"
+ echo "$2" | cryptsetup luksFormat $FORMAT_PARAMS "$1"
}
4 years, 11 months
master - tests: drop call of wipefs
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=4ff472b9071e2a6efef...
Commit: 4ff472b9071e2a6efef96e425cbe38cc63280189
Parent: 9f561f2206bd893ea5ef7052debaff2af97006d1
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat May 4 19:11:00 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sat May 4 19:11:00 2019 +0200
tests: drop call of wipefs
wipefs might not be present on test system.
Devices are also already zeroed by cleanup_md_dev
(which 'fakes' missing wipefs eventually)
---
test/shell/lvm-on-md.sh | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/test/shell/lvm-on-md.sh b/test/shell/lvm-on-md.sh
index 4c66431..41649be 100644
--- a/test/shell/lvm-on-md.sh
+++ b/test/shell/lvm-on-md.sh
@@ -124,10 +124,6 @@ vgremove -f $vg
aux cleanup_md_dev
-wipefs -a "$dev1"
-wipefs -a "$dev2"
-
-
# create 2 disk MD raid0 array
# by default using metadata format 1.0 with data at the end of device
# When a raid0 md array is stopped, the components will not look like
4 years, 11 months
master - pvscan: fix segfault in recent commit
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9f561f2206bd893ea5e...
Commit: 9f561f2206bd893ea5ef7052debaff2af97006d1
Parent: 3405ead1e09aa6916cd5ac84ae629c13991e6ec5
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri May 3 16:51:34 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri May 3 16:51:34 2019 -0500
pvscan: fix segfault in recent commit
commit aa75b31db5478
"pvscan: handle case of scanning PV without metadata last"
failed to recognize that an arg may be null in the case of
'pvscan --cache' (without -aay) which does not keep track
of complete VGs because it does not need to activate them.
---
tools/pvscan.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/tools/pvscan.c b/tools/pvscan.c
index e389106..6d89426 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -759,6 +759,10 @@ static void _check_vg_with_pvid_complete(struct cmd_context *cmd,
*
* . When dev_args is set, then complete VGs that that contain
* devs in dev_args will be returned in found_vgnames.
+ *
+ * found_vgnames is null for 'pvscan --cache' (without -aay)
+ * since the command does not need to keep track of complete
+ * vgs since it does not need to activate them.
*/
static void _online_pvscan_all_devs(struct cmd_context *cmd,
@@ -794,7 +798,7 @@ static void _online_pvscan_all_devs(struct cmd_context *cmd,
}
/* This PV without metadata may complete a VG. */
- if (pvid_without_metadata)
+ if (pvid_without_metadata && found_vgnames)
_check_vg_with_pvid_complete(cmd, found_vgnames, &all_vgs, pvid_without_metadata);
}
4 years, 12 months
master - pvs: remove unnecessary label scan
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3405ead1e09aa6916cd...
Commit: 3405ead1e09aa6916cd5ac84ae629c13991e6ec5
Parent: 6ff1583c1ba58d045fb5c8a198698e0d13f1acee
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri May 3 16:12:43 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri May 3 16:16:29 2019 -0500
pvs: remove unnecessary label scan
The scanning rework missed removing this instance of label scan.
It's no longer needed because of the way that label scan is always
run once from the start of the command. This unnecessary scan
would be triggered by running 'pvs @tag'.
---
tools/reporter.c | 15 +--------------
1 files changed, 1 insertions(+), 14 deletions(-)
diff --git a/tools/reporter.c b/tools/reporter.c
index 48050ec..db982b3 100644
--- a/tools/reporter.c
+++ b/tools/reporter.c
@@ -708,7 +708,6 @@ int report_for_selection(struct cmd_context *cmd,
static void _check_pv_list(struct cmd_context *cmd, struct report_args *args, struct single_report_args *single_args)
{
int i;
- int rescan_done = 0;
if (!args->argv)
return;
@@ -719,12 +718,6 @@ static void _check_pv_list(struct cmd_context *cmd, struct report_args *args, st
if (single_args->args_are_pvs && args->argc) {
for (i = 0; i < args->argc; i++) {
- if (!rescan_done && !dev_cache_get(cmd, args->argv[i], cmd->filter)) {
- cmd->filter->wipe(cmd->filter);
- /* FIXME scan only one device */
- lvmcache_label_scan(cmd);
- rescan_done = 1;
- }
if (*args->argv[i] == '@') {
/*
* Tags are metadata related, not label
@@ -732,13 +725,7 @@ static void _check_pv_list(struct cmd_context *cmd, struct report_args *args, st
*/
if (single_args->report_type == LABEL)
single_args->report_type = PVS;
- /*
- * If we changed the report_type and we did rescan,
- * no need to iterate over dev list further - nothing
- * else would change.
- */
- if (rescan_done)
- break;
+ break;
}
}
}
4 years, 12 months