diff --git a/lib/format1/format1.c b/lib/format1/format1.c index c49226f80..9011982fd 100644 --- a/lib/format1/format1.c +++ b/lib/format1/format1.c @@ -400,7 +400,7 @@ static int _format1_pv_initialise(const struct format_type * fmt, static int _format1_pv_setup(const struct format_type *fmt, struct physical_volume *pv, - struct volume_group *vg __attribute__((unused))) + struct volume_group *vg) { return _format1_pv_initialise(fmt, -1, 0, 0, vg->extent_size, 0, 0, pv); } diff --git a/lib/format_text/archiver.c b/lib/format_text/archiver.c index 8c926f02d..c7246ad70 100644 --- a/lib/format_text/archiver.c +++ b/lib/format_text/archiver.c @@ -296,6 +296,7 @@ int backup_restore_vg(struct cmd_context *cmd, struct volume_group *vg) struct pv_list *pvl; struct format_instance *fid; struct format_instance_ctx fic; + uint32_t tmp; /* * FIXME: Check that the PVs referenced in the backup are @@ -320,11 +321,14 @@ int backup_restore_vg(struct cmd_context *cmd, struct volume_group *vg) /* Add any metadata areas on the PVs */ dm_list_iterate_items(pvl, &vg->pvs) { + tmp = vg->extent_size; + vg->extent_size = 0; if (!vg->fid->fmt->ops->pv_setup(vg->fid->fmt, pvl->pv, vg)) { log_error("Format-specific setup for %s failed", pv_dev_name(pvl->pv)); return 0; } + vg->extent_size = tmp; } if (!vg_write(vg) || !vg_commit(vg)) diff --git a/test/t-pvcreate-usage.sh b/test/t-pvcreate-usage.sh index 9afd86941..85413b214 100755 --- a/test/t-pvcreate-usage.sh +++ b/test/t-pvcreate-usage.sh @@ -133,18 +133,18 @@ check pv_field $dev1 pv_mda_count 2 #COMM 'pv with LVM1 compatible data alignment can be convereted' #compatible == LVM1_PE_ALIGN == 64k -#pvcreate --dataalignment 256k $dev1 -#vgcreate -s 1m $vg $dev1 -#vgconvert -M1 $vg -#vgconvert -M2 $vg -#check pv_field $dev1 pe_start 256.00k -#vgremove $vg +pvcreate --dataalignment 256k $dev1 +vgcreate -s 1m $vg $dev1 +vgconvert -M1 $vg +vgconvert -M2 $vg +check pv_field $dev1 pe_start 256.00k +vgremove $vg #COMM 'pv with LVM1 incompatible data alignment cannot be convereted' pvcreate --dataalignment 10k $dev1 vgcreate -s 1m $vg $dev1 not vgconvert -M1 $vg -#vgremove $vg +vgremove $vg #COMM 'vgcfgrestore allows pe_start=0' #basically it produces nonsense, but it tests vgcfgrestore,