* main - lvcreate: fix crash for unspecified LV name for writecache
@ 2022-01-26 14:10 Zdenek Kabelac
0 siblings, 0 replies; only message in thread
From: Zdenek Kabelac @ 2022-01-26 14:10 UTC (permalink / raw)
To: lvm-devel
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a06ccdf44bd385863792baed887303c714da9685
Commit: a06ccdf44bd385863792baed887303c714da9685
Parent: c6639056e0bb2fc5f072b2c0d6bb629ad17eee6e
Author: Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate: Thu Jan 20 16:01:17 2022 +0100
Committer: Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Wed Jan 26 15:09:58 2022 +0100
lvcreate: fix crash for unspecified LV name for writecache
Fix aplication crash when creating writecached LV with 'automatic' name.
---
tools/lvcreate.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index 79af42685..0115b3c32 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -1691,6 +1691,7 @@ static int _lvcreate_single(struct cmd_context *cmd, const char *vg_name,
struct lvcreate_params *lp = pp->lp;
struct lvcreate_cmdline_params *lcp = pp->lcp;
struct logical_volume *spare = vg->pool_metadata_spare_lv;
+ struct logical_volume *lv;
int ret = ECMD_FAILED;
if (!_read_activation_params(cmd, vg, lp))
@@ -1759,9 +1760,12 @@ static int _lvcreate_single(struct cmd_context *cmd, const char *vg_name,
lp->needs_lockd_init = 1;
}
- if (!lv_create_single(vg, lp))
+ if (!(lv = lv_create_single(vg, lp)))
goto_out;
+ if (!lp->lv_name)
+ lp->lv_name = lv->name; /* Get created LV name when it was not specified */
+
ret = ECMD_PROCESSED;
out:
if (ret != ECMD_PROCESSED && !spare && vg->pool_metadata_spare_lv)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-01-26 14:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-26 14:10 main - lvcreate: fix crash for unspecified LV name for writecache Zdenek Kabelac
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.