From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - activation: use existing LV as best effort
Date: Wed, 10 Mar 2021 00:36:37 +0000 (GMT) [thread overview]
Message-ID: <20210310003637.ACA783857C5F@sourceware.org> (raw)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=131ca0eb9582dd183ed40400caf4fc832f43cb16
Commit: 131ca0eb9582dd183ed40400caf4fc832f43cb16
Parent: 15c588f931d3b30344352a49d7f8df6dc5ea873c
Author: Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate: Tue Mar 9 18:23:42 2021 +0100
Committer: Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Wed Mar 10 01:29:06 2021 +0100
activation: use existing LV as best effort
Returning NULL for lv_committed is basically instant crash,
so instead try with passed LV instead.
It shouldn't matter as this is internall error path anyway,
but coverity should be happier.
---
lib/metadata/metadata.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index f82ada8be..71e59207d 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -4335,7 +4335,7 @@ char *tags_format_and_copy(struct dm_pool *mem, const struct dm_list *tagsl)
const struct logical_volume *lv_committed(const struct logical_volume *lv)
{
struct volume_group *vg;
- struct logical_volume *found_lv;
+ const struct logical_volume *found_lv;
if (!lv)
return NULL;
@@ -4348,7 +4348,7 @@ const struct logical_volume *lv_committed(const struct logical_volume *lv)
if (!(found_lv = find_lv_in_vg_by_lvid(vg, &lv->lvid))) {
log_error(INTERNAL_ERROR "LV %s (UUID %s) not found in committed metadata.",
display_lvname(lv), lv->lvid.s);
- return NULL;
+ found_lv = lv; /* Use uncommitted LV as best effort */
}
return found_lv;
reply other threads:[~2021-03-10 0:36 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=20210310003637.ACA783857C5F@sourceware.org \
--to=zkabelac@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.