mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
303e86adc8
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). |
||
---|---|---|
.. | ||
lv_alloc.h | ||
lv_manip.c | ||
lv.c | ||
lv.h | ||
merge.c | ||
metadata-exported.h | ||
metadata.c | ||
metadata.h | ||
mirror.c | ||
pv_alloc.h | ||
pv_manip.c | ||
pv_map.c | ||
pv_map.h | ||
pv.c | ||
pv.h | ||
raid_manip.c | ||
replicator_manip.c | ||
segtype.c | ||
segtype.h | ||
snapshot_manip.c | ||
thin_manip.c | ||
vg.c | ||
vg.h |