diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2020-01-30 15:54:19 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2020-02-04 17:22:06 +0100 |
commit | 336361b2f25c09c7aad4d21aca272a11c6c9352a (patch) | |
tree | 9882078ddce3cc21795ca0256e337601ecebfdd2 | |
parent | 67f627c8fbcd5224a1439cbef590e488f6c4823b (diff) | |
download | lvm2-336361b2f25c09c7aad4d21aca272a11c6c9352a.tar.gz |
lv_manip: add extra check for existin origin_lv
clang: it's supposedly impossible path to hit, as we should always
have origin_lv defined when running this path, but adding protection
isn't a big issue to make this obvious to analyzer.
-rw-r--r-- | lib/metadata/lv_manip.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index ad9c756f6..c9f7348fa 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -8372,7 +8372,8 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, * COW LV is activated via implicit activation of origin LV * Only the snapshot origin holds the LV lock in cluster */ - if (!vg_add_snapshot(origin_lv, lv, NULL, + if (!origin_lv || + !vg_add_snapshot(origin_lv, lv, NULL, origin_lv->le_count, lp->chunk_size)) { log_error("Couldn't create snapshot."); goto deactivate_and_revert_new_lv; |