1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00
lvm2/lib/format_text
Peter Rajnoha 3c978f7bcc pvcreate: fix check for 2nd mda at end of disk fits if using pvcreate --restorefile
Fix code checking that the 2nd mda which is at the end of disk really
fits the available free space and avoid any DA and MDA interleaving when
we already have DA preallocated. This mainly applies when we're restoring
a PV from VG backup using pvcreate --restorefile where we may already have
some DA preallocated - this means the PV was in a VG before with already
allocated space from it (the LVs were created). Hence we need to avoid
stepping into DA - the MDA can never ever be inside in such case!

The code responsible for this calculation was already in
_text_pv_add_metadata_area fn, but it had a bug in the calculation where
we subtracted one more sector by mistake and then the code could still
incorrectly allocate the MDA inside existing DA. The patch also renames
the variable in the code so it doesn't confuse us in future.

Also, if the 2nd mda doesn't fit, don't silently continue with just 1
MDA (at the start of the disk). If 2nd mda was requested and we can't
create that due to unavailable space, error out correctly (the patch
also adds a test to shell/pvcreate-operation.sh for this case).
2017-08-15 13:40:25 +02:00
..
archive.c doc: change fsf address 2016-01-21 12:11:37 +01:00
archiver.c backup: show warning once per command 2016-12-18 19:38:30 +01:00
archiver.h vgcfgrestore: use lvmetad disabled state 2016-06-20 11:19:49 -05:00
export.c cleanup: add braces in macro 2017-07-20 11:18:29 +02:00
flags.c raid: add data_offset incompatibility segment type flag 2017-07-14 15:53:23 +02:00
format-text.c pvcreate: fix check for 2nd mda at end of disk fits if using pvcreate --restorefile 2017-08-15 13:40:25 +02:00
format-text.h cov: declaration matching 2016-12-11 23:24:19 +01:00
import_vsn1.c cleanup: add braces in macro 2017-07-20 11:18:29 +02:00
import-export.h tidy: declaration names match implementation 2017-07-20 19:16:41 +02:00
import.c config: parse config tree without dup node checking if it's metadata tree 2016-09-21 18:16:05 +02: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 coverity: fix possible resource leak of descendants_buffer in _print_historical_lv fn 2016-05-31 09:36:58 +02: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