diff options
author | David Teigland <teigland@redhat.com> | 2020-02-13 13:26:16 -0600 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2020-02-13 13:26:16 -0600 |
commit | b5ba00c773289ea5525df4e62bf7f675da2e2ee6 (patch) | |
tree | 26f6174ef019ca344ded7449adc827f8443d996b | |
parent | 3ece8166aee9e934c077489ed17211cb91d035f7 (diff) | |
download | lvm2-dev-dct-integrity21.tar.gz |
integrity: allocate imeta on same PV as rimage and rimagedev-dct-integrity21
-rw-r--r-- | lib/metadata/integrity_manip.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/metadata/integrity_manip.c b/lib/metadata/integrity_manip.c index 246c7446b..d904a26cd 100644 --- a/lib/metadata/integrity_manip.c +++ b/lib/metadata/integrity_manip.c @@ -520,6 +520,7 @@ int lv_add_integrity_to_raid(struct logical_volume *lv, const char *arg, struct dm_list *pvh) { struct lvcreate_params lp; + struct dm_list allocatable_pvs; struct logical_volume *imeta_lvs[DEFAULT_RAID_MAX_IMAGES]; struct cmd_context *cmd = lv->vg->cmd; struct volume_group *vg = lv->vg; @@ -528,7 +529,7 @@ int lv_add_integrity_to_raid(struct logical_volume *lv, const char *arg, const struct segment_type *segtype; struct integrity_settings *set; struct device *meta_dev = NULL; - struct dm_list *use_pvh = pvh; + struct dm_list *use_pvh = NULL; uint64_t status_data_sectors = 0; uint32_t area_count, s; uint32_t revert_meta_lvs = 0; @@ -617,6 +618,16 @@ int lv_add_integrity_to_raid(struct logical_volume *lv, const char *arg, goto_bad; } + dm_list_init(&allocatable_pvs); + + if (!get_pv_list_for_lv(cmd->mem, lv_image, &allocatable_pvs)) { + log_error("Failed to build list of PVs for %s.", display_lvname(lv_image)); + goto_bad; + } + + if (!use_pvh) + use_pvh = &allocatable_pvs; + /* * allocate a new linear LV NAME_rimage_N_imeta */ |