From: Peter Rajnoha <prajnoha@sourceware.org>
To: lvm-devel@redhat.com
Subject: master - toollib: fix segfault when handling selection with historical LVs
Date: Thu, 5 May 2022 09:14:18 +0000 (GMT) [thread overview]
Message-ID: <20220505091418.41EE13858434@sourceware.org> (raw)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7ec0726ce331a4dc1ab5dc5e1b9ae503e5d758da
Commit: 7ec0726ce331a4dc1ab5dc5e1b9ae503e5d758da
Parent: ff6022d400430df2f51160ce9eec4010ac55696c
Author: Peter Rajnoha <prajnoha@redhat.com>
AuthorDate: Thu May 5 11:02:32 2022 +0200
Committer: Peter Rajnoha <prajnoha@redhat.com>
CommitterDate: Thu May 5 11:13:39 2022 +0200
toollib: fix segfault when handling selection with historical LVs
When processing historical LVs inside process_each_lv_in_vg for
selection, we need to use dummy "_historical_lv" for select_match_lv.
This is because a historical LV is not an actual LV, but only a tiny
representation with subset of original properties that we recorded
(name, uuid...).
To use the same processing functions we use for full-fledged non-historical
LVs, we need to use the prefilled "_historical_lv" structure which has all
the other missing properties hard-coded.
---
WHATS_NEW | 1 +
tools/toollib.c | 7 ++++---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index fad32ab08..db8265a78 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.03.16 -
====================================
+ Fix segfault when handling selection with historical LVs.
Add support --vdosettings with lvcreate, lvconvert, lvchange.
Fix lossing of delete message on thin-pool extension.
diff --git a/tools/toollib.c b/tools/toollib.c
index 545407c2f..d77092d89 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -3447,13 +3447,14 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
process_lv = 1;
}
- process_lv = process_lv && select_match_lv(cmd, handle, vg, lvl->lv) && _select_matches(handle);
+ _historical_lv.this_glv = glvl->glv;
+ _historical_lv.name = glvl->glv->historical->name;
+
+ process_lv = process_lv && select_match_lv(cmd, handle, vg, &_historical_lv) && _select_matches(handle);
if (!process_lv)
continue;
- _historical_lv.this_glv = glvl->glv;
- _historical_lv.name = glvl->glv->historical->name;
log_very_verbose("Processing historical LV %s in VG %s.", glvl->glv->historical->name, vg->name);
ret = process_single_lv(cmd, &_historical_lv, handle);
reply other threads:[~2022-05-05 9:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220505091418.41EE13858434@sourceware.org \
--to=prajnoha@sourceware.org \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.