diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2020-01-30 15:46:05 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2020-02-04 17:22:06 +0100 |
commit | 67f627c8fbcd5224a1439cbef590e488f6c4823b (patch) | |
tree | 348f0796ce5adb2ff7b8936ad892b656c8a02447 | |
parent | 409362c127222640cd2d1fe3e1b62b50867741c1 (diff) | |
download | lvm2-67f627c8fbcd5224a1439cbef590e488f6c4823b.tar.gz |
raid: add internal error for no segment
clang: capture internal error when data_seg would not be defined.
(invalid LV with no areas)
-rw-r--r-- | lib/metadata/raid_manip.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c index 486dea11a..dfc6fe532 100644 --- a/lib/metadata/raid_manip.c +++ b/lib/metadata/raid_manip.c @@ -4277,6 +4277,11 @@ static int _raid0_to_striped_retrieve_segments_and_lvs(struct logical_volume *lv return_0; } + if (!data_seg) { + log_error(INTERNAL_ERROR "No segment for %s.", display_lvname(lv)); + return 0; + } + /* Presumes all data LVs have equal size */ area_le += data_seg->len; } |