1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00
lvm2/tools
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
..
.exported_symbols generate liblvm2cmd exported symbols too 2010-06-25 18:23:10 +00:00
.gitignore gitignore: Update for in-place build. 2015-07-27 13:18:35 +01:00
args.h cleanup: rename usepolicies 2016-02-11 18:35:06 +01:00
cmdnames.h doc: change fsf address 2016-01-21 12:11:37 +01:00
commands.h cleanup: rename usepolicies 2016-02-11 18:35:06 +01:00
dmsetup.c doc: change fsf address 2016-01-21 12:11:37 +01:00
dumpconfig.c doc: change fsf address 2016-01-21 12:11:37 +01:00
errors.h doc: change fsf address 2016-01-21 12:11:37 +01:00
formats.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvchange.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvconvert_poll.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvconvert_poll.h doc: change fsf address 2016-01-21 12:11:37 +01:00
lvconvert.c cleanup: rename usepolicies 2016-02-11 18:35:06 +01:00
lvcreate.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvdisplay.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvextend.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm2cmd-static.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm2cmd.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm2cmd.h doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm2cmdline.h doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm-static.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvmchange.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvmcmdlib.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvmcmdline.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvmdiskscan.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvpoll.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvreduce.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvremove.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvrename.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvresize.c cleanup: drop unneeded assigns 2016-02-11 18:35:07 +01:00
lvscan.c doc: change fsf address 2016-01-21 12:11:37 +01:00
Makefile.in doc: change fsf address 2016-01-21 12:11:37 +01:00
polldaemon.c doc: change fsf address 2016-01-21 12:11:37 +01:00
pvchange.c pv: check for the PV_EXT_USED flag and deny pvcreate/pvchange/pvremove/vgcreate on such PV (unless forced) 2016-02-15 12:44:46 +01:00
pvck.c doc: change fsf address 2016-01-21 12:11:37 +01:00
pvcreate.c doc: change fsf address 2016-01-21 12:11:37 +01:00
pvdisplay.c doc: change fsf address 2016-01-21 12:11:37 +01:00
pvmove_poll.c doc: change fsf address 2016-01-21 12:11:37 +01:00
pvmove_poll.h doc: change fsf address 2016-01-21 12:11:37 +01:00
pvmove.c doc: change fsf address 2016-01-21 12:11:37 +01:00
pvremove.c doc: change fsf address 2016-01-21 12:11:37 +01:00
pvresize.c doc: change fsf address 2016-01-21 12:11:37 +01:00
pvscan.c doc: change fsf address 2016-01-21 12:11:37 +01:00
reporter.c doc: change fsf address 2016-01-21 12:11:37 +01:00
segtypes.c doc: change fsf address 2016-01-21 12:11:37 +01:00
stub.h doc: change fsf address 2016-01-21 12:11:37 +01:00
tags.c doc: change fsf address 2016-01-21 12:11:37 +01:00
tool.h doc: change fsf address 2016-01-21 12:11:37 +01:00
toollib.c metadata: _vg_read: check if PV_EXT_USED flag is set correctly for orphan PVs and do a repair if needed 2016-02-15 12:44:46 +01:00
toollib.h doc: change fsf address 2016-01-21 12:11:37 +01:00
tools.h doc: change fsf address 2016-01-21 12:11:37 +01:00
vgcfgbackup.c doc: change fsf address 2016-01-21 12:11:37 +01:00
vgcfgrestore.c doc: change fsf address 2016-01-21 12:11:37 +01:00
vgchange.c doc: change fsf address 2016-01-21 12:11:37 +01:00
vgck.c doc: change fsf address 2016-01-21 12:11:37 +01:00
vgconvert.c backup: backup_restore_vg: register PVs that need writing via vg->pvs_to_write list 2016-02-15 12:44:46 +01:00
vgcreate.c doc: change fsf address 2016-01-21 12:11:37 +01:00
vgdisplay.c doc: change fsf address 2016-01-21 12:11:37 +01:00
vgexport.c doc: change fsf address 2016-01-21 12:11:37 +01:00
vgextend.c doc: change fsf address 2016-01-21 12:11:37 +01:00
vgimport.c doc: change fsf address 2016-01-21 12:11:37 +01:00
vgmerge.c doc: change fsf address 2016-01-21 12:11:37 +01:00
vgmknodes.c doc: change fsf address 2016-01-21 12:11:37 +01:00
vgreduce.c doc: change fsf address 2016-01-21 12:11:37 +01:00
vgremove.c doc: change fsf address 2016-01-21 12:11:37 +01:00
vgrename.c doc: change fsf address 2016-01-21 12:11:37 +01:00
vgscan.c doc: change fsf address 2016-01-21 12:11:37 +01:00
vgsplit.c doc: change fsf address 2016-01-21 12:11:37 +01:00