1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib
Peter Rajnoha 303e86adc8 pvcreate: fix alignment to incorporate alignment offset if PV has 0 MDAs
If zero metadata copies are used, there's no further recalculation of
PV alignment that happens when adding metadata areas to the PV and
which actually calculates the alignment correctly as a matter of fact.
So fix this for "PV without MDA" case as well.

Before this patch:
[1] raw/~ # pvcreate --dataalignment 8m --dataalignmentoffset 4m
--metadatacopies 1 /dev/sda
  Physical volume "/dev/sda" successfully created
[1] raw/~ # pvs -o pv_name,pe_start
  PV         1st PE
  /dev/sda    12.00m
[1] raw/~ # pvcreate --dataalignment 8m --dataalignmentoffset 4m
--metadatacopies 0 /dev/sda
  Physical volume "/dev/sda" successfully created
[1] raw/~ # pvs -o pv_name,pe_start
  PV         1st PE
  /dev/sda     8.00m

After this patch:
[1] raw/~ # pvcreate --dataalignment 8m --dataalignmentoffset 4m
--metadatacopies 1 /dev/sda
  Physical volume "/dev/sda" successfully created
[1] raw/~ # pvs -o pv_name,pe_start
  PV         1st PE
  /dev/sda    12.00m
[1] raw/~ # pvcreate --dataalignment 8m --dataalignmentoffset 4m
--metadatacopies 0 /dev/sda
  Physical volume "/dev/sda" successfully created
[1] raw/~ # pvs -o pv_name,pe_start
  PV         1st PE
  /dev/sda    12.00m

Also, remove a superfluous condition "pv->pe_start < pv->pe_align" in:
  if (pe_start == PV_PE_START_CALC && pv->pe_start < pv->pe_align)
    pv->pe_start = pv->pe_align ...
This part of the condition is not reachable as with the PV_PE_START_CALC,
we always have pv->pe_start set to 0 from the PV struct initialisation
(...the pv->pe_start value is just being calculated).
2013-02-21 14:51:19 +01:00
..
activate clean-up: Another functiont that can use 'lv_layer' 2013-02-04 17:10:16 -06:00
cache cleanup: old style gcc 2013-02-05 16:54:12 +01:00
commands logging: add debug classes 2013-01-07 22:25:19 +00:00
config RAID: Add new 'raid10_segtype_default' setting in lvm.conf 2013-02-20 15:10:04 -06:00
datastruct Switch to return void 2012-02-08 12:52:58 +00:00
device logging: classify log_debug messages 2013-01-07 22:30:29 +00:00
display buffering: use unbuffered silent mode for liblvm 2012-08-26 00:15:45 +01:00
error cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00
filters filters: add scm devices 2013-01-11 09:24:07 +01:00
format1 logging: classify log_debug messages 2013-01-07 22:30:29 +00:00
format_pool logging: classify log_debug messages 2013-01-07 22:30:29 +00:00
format_text pvcreate: fix alignment to incorporate alignment offset if PV has 0 MDAs 2013-02-21 14:51:19 +01:00
freeseg cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00
label logging: classify log_debug messages 2013-01-07 22:30:29 +00:00
locking logging: classify log_debug messages 2013-01-07 22:30:29 +00:00
log logging: add debug classes 2013-01-07 22:25:19 +00:00
metadata pvcreate: fix alignment to incorporate alignment offset if PV has 0 MDAs 2013-02-21 14:51:19 +01:00
mirror clean-up: Rename lvm.conf setting 'mirror_region_size' to 'raid_region_size' 2013-02-20 14:40:17 -06:00
misc logging: classify log_debug messages 2013-01-07 22:30:29 +00:00
mm logging: classify log_debug messages 2013-01-07 22:30:29 +00:00
raid RAID: Add support for RAID10 2012-08-24 15:34:19 -05:00
replicator cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00
report report: leave empty report field for 0 2013-02-05 14:32:37 +01:00
snapshot Differentiate between snapshot status of "Invalid" and "Merge failed". 2012-01-20 22:02:04 +00:00
striped Add activation/use_linear_target enabled by default. (prajnoha) 2011-11-28 20:37:51 +00:00
thin thin: replace is_active with send_messages 2013-02-04 19:01:10 +01:00
unknown cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00
uuid Revert the #include changes. Need to fix this at the #include site for now, and 2011-07-18 14:34:33 +00:00
zero cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00
Makefile.in cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00