1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib
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
..
activate tidy: declaration names match implementation 2017-07-20 19:16:41 +02:00
cache tidy: declaration names match implementation 2017-07-20 19:16:41 +02:00
cache_segtype cache: fix lvdisplay output 2017-06-22 20:17:18 +02:00
commands toolcontext: Improve invalid units error message. 2017-07-27 00:51:50 +01:00
config lvmconfig: Add options to produce file preamble 2017-08-05 16:23:34 +01:00
datastruct datastruct: Add str_list_wipe. 2016-04-29 19:47:15 +01:00
device tidy: drop unneeded cast 2017-07-20 11:20:44 +02:00
display coverity: validate retval from get_only_segment_using_this_lv 2017-06-27 00:27:36 +02:00
error activate: Use macros for target and module names. 2016-03-22 17:46:15 +00:00
filters tidy: prefer not using else after return 2017-07-20 11:18:29 +02:00
format1 tidy: else after continue 2017-07-20 11:18:29 +02:00
format_pool lvconvert: add infrastructure for RaidLV reshaping support 2017-02-24 05:20:58 +01:00
format_text pvcreate: fix check for 2nd mda at end of disk fits if using pvcreate --restorefile 2017-08-15 13:40:25 +02:00
freeseg doc: change fsf address 2016-01-21 12:11:37 +01:00
label pvcreate: Wipe cached bootloaderarea when wiping label. 2017-08-11 20:32:04 +01:00
locking tidy: prefer not using else after return 2017-07-20 11:18:29 +02:00
log log: fix message prefix truncation 2017-06-27 12:41:59 +01:00
lvmpolld doc: change fsf address 2016-01-21 12:11:37 +01:00
metadata raid: more validation checks for segment data_offset member 2017-08-14 15:00:15 +02:00
mirror mirror/raid: display adjusted region size with units 2017-04-20 20:42:21 +02:00
misc cleanup: whitespace 2017-07-11 16:26:12 +02:00
mm cleanup: compile fixes for --disable-devmapper 2016-06-03 12:46:43 +02:00
notify dbus: also recognize error state for missing service that comes from original D-Bus 2016-11-15 10:09:11 +01:00
properties doc: change fsf address 2016-01-21 12:11:37 +01:00
raid raid: fix allocation/activation of reshape space 2017-07-14 15:53:23 +02:00
replicator tidy: prefer not using else after return 2017-07-20 11:18:29 +02:00
report tidy: prefer not using else after return 2017-07-20 11:18:29 +02:00
snapshot activate: Use macros for target and module names. 2016-03-22 17:46:15 +00:00
striped striped: implement compatible target name 2016-12-05 17:02:01 +01:00
thin thin: add new ZERO/DISCARDS_UNSELECTED 2017-03-10 19:33:00 +01:00
unknown doc: change fsf address 2016-01-21 12:11:37 +01:00
uuid cleanup :drop unneeded header file 2016-10-03 17:49:56 +02:00
zero activate: Use macros for target and module names. 2016-03-22 17:46:15 +00:00
Makefile.in makefiles: cleanups 2017-08-01 11:53:32 +02:00