1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib/format_text
Peter Rajnoha d84a80afb5 backup: backup_restore_vg: register PVs that need writing via vg->pvs_to_write list
The backup_restore_vg is used directly for restoring the VG from backup.
It's also used to do the VG conversions from one metadata format to
another which means vgconvert calls backup_restore_vg too.

When restoring VG from backup, we need to rewrite/write PV headers as
PVs may have been orphans before and now they're becoming part of some
VG - we need to write the PV_EXT_USED flag at least.

When using the backup_restore_vg for vgconvert, we need to write
completely new PV header in different format.

Avoid the special "pv_write" call and handling that was used before
this patch in vgconvert (vgconvert_single function to be more precise)
and reuse existing internal interface to register PV header for writing
(or rewriting) via vg->pvs_to_write list instead like we do it elsewhere
in the code.

This patch also resolves a problem in which PV headers with target
format were written in the vgconvert_single fn as orphans and VG
metadata were added later on - this was a tiny hack actually.
We can't do this now - we need to write the PV as belonging
to a VG because otherwise the PV_EXT_USED flag won't be written
properly (if the PV header is written as orphan, the PV_EXT_USED
is set to 0, of course, even though metadata are attached later).
So this patch removes this tiny inconsistency which was passing
just fine before because we didn't have any relation to the VG
in PV header before. Now we have the PV_EXT_USED flag which says
the "PV is used in some VG".
2016-02-15 12:44:46 +01:00
..
archive.c doc: change fsf address 2016-01-21 12:11:37 +01:00
archiver.c backup: backup_restore_vg: register PVs that need writing via vg->pvs_to_write list 2016-02-15 12:44:46 +01:00
archiver.h backup: backup_restore_vg: register PVs that need writing via vg->pvs_to_write list 2016-02-15 12:44:46 +01:00
export.c doc: change fsf address 2016-01-21 12:11:37 +01:00
flags.c doc: change fsf address 2016-01-21 12:11:37 +01:00
format-text.c pv: format-text: store PV_EXT_USED flag if PV is used and unset it otherwise 2016-02-15 12:44:46 +01:00
format-text.h doc: change fsf address 2016-01-21 12:11:37 +01:00
import_vsn1.c doc: change fsf address 2016-01-21 12:11:37 +01:00
import-export.h doc: change fsf address 2016-01-21 12:11:37 +01:00
import.c doc: change fsf address 2016-01-21 12:11:37 +01:00
layout.h metadata: introduce PV_EXT_USED flag and bump PV_HEADER_EXTENSION_VSN 2016-02-15 12:44:46 +01:00
text_export.h doc: change fsf address 2016-01-21 12:11:37 +01:00
text_import.h doc: change fsf address 2016-01-21 12:11:37 +01:00
text_label.c lvmcache/lvmetad: cache PV extension version 2016-02-15 12:44:46 +01:00