Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f331eb1c0d060529a3b5e…
Commit: f331eb1c0d060529a3b5e6517c8ac423e21796d3
Parent: fd6661dfcf7568d32a127e63b0d6c95c010688fb
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Mar 17 14:16:09 2018 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sat Mar 17 23:33:58 2018 +0100
coverity: ensure lock_type is not NULL
---
tools/vgchange.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/vgchange.c b/tools/vgchange.c
index 6d739fe..7cfaab6 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -955,7 +955,7 @@ static int _vgchange_locktype(struct cmd_context *cmd, struct volume_group *vg)
vg->lock_type = "none";
}
- if (!strcmp(vg->lock_type, lock_type)) {
+ if (lock_type && !strcmp(vg->lock_type, lock_type)) {
log_warn("New lock type %s matches the current lock type %s.",
lock_type, vg->lock_type);
return 1;
@@ -1180,7 +1180,7 @@ int vgchange_locktype_cmd(struct cmd_context *cmd, int argc, char **argv)
* just return success when they see the disable flag set.
*/
if (lockopt && !strcmp(lockopt, "force")) {
- if (strcmp(lock_type, "none")) {
+ if (lock_type && strcmp(lock_type, "none")) {
log_error("Lock type can only be forced to \"none\" for recovery.");
return 0;
}
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d68d71013fb261c87f1d3…
Commit: d68d71013fb261c87f1d3a26ebf098644055c6d1
Parent: 9553dc77611e787999923a4cfeb223360ce00672
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Fri Mar 16 15:47:12 2018 +0100
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Fri Mar 16 15:57:53 2018 +0100
lvcreate: remove RaidLV on creation failure
In case a newly created RaidLV is blacklisted using config
\"activation { volume list = [ ... ] }\" (i.e. its SubLVs stay inactive),
the metadata SubLVs can't get wiped thus failing the creation.
As a result, the RaidLV together with its SubLVs
is left behind in an inconsistent state.
Fix by removing the RaidLV and provide a hint about volume_list reasoning.
Resolves: rhbz1161347
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 11 +++++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index da5f5f4..2ec7f7e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.178 -
=====================================
+ Remove RaidLV on creation failure when rmeta devices can't be activated.
Add prioritized_section() to restore cookie boundaries (2.02.177).
Enhance error messages when read error happens.
Enhance mirror log initialization for old mirror target.
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 9566f3e..da5e355 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -4100,9 +4100,16 @@ static int _lv_extend_layered_lv(struct alloc_handle *ah,
str_list_wipe(&meta_lv->tags);
}
- if (fail)
+ if (fail) {
/* Fail, after trying to deactivate all we could */
+ struct volume_group *vg = lv->vg;
+
+ if (!lv_remove(lv))
+ log_error("Failed to remove LV");
+ else if (!vg_write(vg) || !vg_commit(vg))
+ log_error("Failed to commit VG %s", vg->name);
return_0;
+ }
}
for (s = 0; s < seg->area_count; s++)
@@ -7155,7 +7162,7 @@ int wipe_lv(struct logical_volume *lv, struct wipe_params wp)
}
if (!lv_is_active_locally(lv)) {
- log_error("Volume \"%s/%s\" is not active locally.",
+ log_error("Volume \"%s/%s\" is not active locally (volume_list activation filter?).",
lv->vg->name, lv->name);
return 0;
}