1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib/metadata
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
..
lv_alloc.h discards: don't discard reconfigured extents 2012-06-27 22:12:01 +01:00
lv_manip.c clean-up: Rename lvm.conf setting 'mirror_region_size' to 'raid_region_size' 2013-02-20 14:40:17 -06:00
lv.c activate: add lv_layer function 2013-02-04 19:01:10 +01:00
lv.h activate: add lv_layer function 2013-02-04 19:01:10 +01:00
merge.c logging: classify log_debug messages 2013-01-07 22:30:29 +00:00
metadata-exported.h RAID: Make 'vgreduce --removemissing' work with RAID LVs 2013-02-20 14:52:46 -06:00
metadata.c pvcreate: fix alignment to incorporate alignment offset if PV has 0 MDAs 2013-02-21 14:51:19 +01:00
metadata.h thin: update pool_is_active 2013-02-05 16:54:11 +01:00
mirror.c cleanup: add internal error check 2013-02-05 14:27:24 +01:00
pv_alloc.h discards: split discard from release_pv_segment 2012-06-27 22:11:54 +01:00
pv_manip.c logging: classify log_debug messages 2013-01-07 22:30:29 +00:00
pv_map.c logging: classify log_debug messages 2013-01-07 22:30:29 +00:00
pv_map.h Track unreserved space for all alloc policies and then permit NORMAL to place 2012-02-01 02:10:45 +00:00
pv.c report: fix pvs -o pv_free reporting for PVs with 0 PEs 2013-02-21 13:28:07 +01:00
pv.h Defer writing PV labels to vg_write. 2011-06-01 19:29:31 +00:00
raid_manip.c clean-up: Remove a FIXME question that has been settled 2013-02-20 15:03:58 -06:00
replicator_manip.c logging: classify log_debug messages 2013-01-07 22:30:29 +00:00
segtype.c Handle metadata with unknown segment types more gracefully. 2009-10-16 17:41:49 +00:00
segtype.h Use a more correct macro for 'seg_is_linear' 2011-10-14 14:21:32 +00:00
snapshot_manip.c Reinstate support for format1 snapshots, but issue deprecated warning. 2011-12-20 00:02:18 +00:00
thin_manip.c thin: update pool_is_active 2013-02-05 16:54:11 +01:00
vg.c logging: classify log_debug messages 2013-01-07 22:30:29 +00:00
vg.h Add free_orphan_vg 2012-02-13 11:03:59 +00:00