1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib/metadata
David Teigland 8b7a78c728 lvmcache: improve duplicate PV handling
Wait to compare and choose alternate duplicate devices until
after all devices are scanned.  During scanning, the first
duplicate dev is kept in lvmcache, and others are kept in a
new list (_found_duplicate_devs).

After all devices are scanned, compare all the duplicates
available for a given PVID and decide which is best.

If the dev used in lvmcache is changed, drop the old dev
from lvmcache entirely and rescan the replacement dev.
Previously the VG metadata from the old dev was kept in
lvmcache and only the dev was replaced.

A new config setting devices/allow_changes_with_duplicate_pvs
can be set to 0 which disallows modifying a VG or activating
LVs in it when the VG contains PVs with duplicate devices.
Set to 1 is the old behavior which allowed the VG to be
changed.

The logic for which of two devs is preferred has changed.
The primary goal is to choose a device that is currently
in use if the other isn't, e.g. by an active LV.

. prefer dev with fs mounted if the other doesn't, else
. prefer dev that is dm if the other isn't, else
. prefer dev in subsystem if the other isn't

If neither device is preferred by these rules, then don't
change devices in lvmcache, leaving the one that was found
first.

The previous logic for preferring a device was:

. prefer dev in subsystem if the other isn't, else
. prefer dev without holders if the other has holders, else
. prefer dev that is dm if the other isn't
2016-05-06 09:00:00 -05:00
..
cache_manip.c cache: add cache_set_params function 2016-05-05 23:30:49 +02:00
lv_alloc.h doc: change fsf address 2016-01-21 12:11:37 +01:00
lv_manip.c cleanup: just switch error path 2016-05-05 23:52:06 +02:00
lv.c cache: check for cache fail during flush 2016-03-10 18:38:53 +01:00
lv.h coverity: avoid using signed types for single bits 2016-04-22 01:12:34 +02:00
merge.c metadata: also validate historical LVs in VG in vg_validate and check_lv_segments 2016-03-03 13:50:59 +01:00
metadata-exported.h cache: add cache_set_params function 2016-05-05 23:30:49 +02:00
metadata.c lvmcache: improve duplicate PV handling 2016-05-06 09:00:00 -05:00
metadata.h metadata: add support for interconnection of thin pool LV segment with indirect origin 2016-03-03 13:46:40 +01:00
mirror.c metadata: also look at historical LVs when checking LV name availability 2016-03-03 13:50:59 +01:00
pool_manip.c metadata: also look at historical LVs when checking LV name availability 2016-03-03 13:50:59 +01:00
pv_alloc.h doc: change fsf address 2016-01-21 12:11:37 +01:00
pv_manip.c cleanup: indent 2016-02-25 23:30:25 +01:00
pv_map.c doc: change fsf address 2016-01-21 12:11:37 +01:00
pv_map.h doc: change fsf address 2016-01-21 12:11:37 +01:00
pv.c report: Shift (u)sed pv_attr under (a)llocatable. 2016-02-26 15:46:37 +00:00
pv.h pv: add is_used_pv fn 2016-02-15 12:44:46 +01:00
raid_manip.c raid_manip: allow for raid leg to be replaced when not both data and metadata image are on pvs 2016-03-07 15:25:30 +01:00
replicator_manip.c doc: change fsf address 2016-01-21 12:11:37 +01:00
segtype.c doc: change fsf address 2016-01-21 12:11:37 +01:00
segtype.h doc: change fsf address 2016-01-21 12:11:37 +01:00
snapshot_manip.c display: Avoid internal snapshot LV names in msgs. 2016-04-21 00:30:17 +01:00
thin_manip.c gcc: cleanup some sign warnings 2016-02-23 12:25:25 +01:00
vg.c metadata: add historical_glv_remove 2016-03-03 13:50:57 +01:00
vg.h metadata: add historical_glv_remove 2016-03-03 13:50:57 +01:00