1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-09 01:18:39 +03:00
lvm2/lib/metadata
Jonathan Earl Brassow 9ab111abc0 Fix for bug 732142: Unsafe table load during mirror image split
There was a bad sequence:
*) Make changes to LV layout to split images (e.g. 4-way -> 2-way/2-way)
1) vg_write, suspend_lv(original_mirror), vg_commit
2) activate_lv(newly_split_lv)
3) resume_lv(original_mirror)

Step #2 is not allowed.  However, without it, the resume of the original
mirror will also resume its former sub-LVs - making it impossible to
activate the newly split LV due to the changes in layering, pointers, and
names that had already been made.  Additionally, the resume or the original
brings the sub-lv's online with names that differ from the metadata on disk -
also a no-no.  Thus, the split must be done in stages such that the active LVs
always reflect what is in the committed LVM metadata.

First, alter the original mirror by releasing the images.  The images are made
visible and independent as an intermediate stage.  (This way, we can have
consistency between LVM metadata and active LVs.)  The second stage collects
the recently split LVs, deactivates them, forms them into a mirror if necessary,
and then activates them.  It is a bit of a circuitous method, but it is the only
way to split a mirror from a mirror and obey these general rules:
1) Never [de]activate sub-lvs when the top-level LV is suspended
2) Avoid having active LVs that differ from the description in the LVM metadata

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
2011-09-01 19:22:11 +00:00
..
lv_alloc.h Remove and unneeded parameter from build_parallel_areas_from_lv() 2011-07-19 16:37:42 +00:00
lv_manip.c Move the core of the lib/config/config.c functionality into libdevmapper, 2011-08-30 14:55:15 +00:00
lv.c This patchset refactors some reporting code and completes the remaining 2011-04-12 12:24:29 +00:00
lv.h This patchset refactors some reporting code and completes the remaining 2011-04-12 12:24:29 +00:00
merge.c Add basic RAID segment type(s) support. 2011-08-02 22:07:20 +00:00
metadata-exported.h thin - hide unimplemented dso fn; remove duplicate origin_lv field; add 2011-08-26 17:40:53 +00:00
metadata.c Move the core of the lib/config/config.c functionality into libdevmapper, 2011-08-30 14:55:15 +00:00
metadata.h Use size_t return type 2011-09-01 10:25:22 +00:00
mirror.c Fix for bug 732142: Unsafe table load during mirror image split 2011-09-01 19:22:11 +00:00
pv_alloc.h Fix all segments memory is allocated from vg private mempool. 2010-03-31 17:23:18 +00:00
pv_manip.c Improve the discard documentation. Also improve discard code in 2011-04-13 18:26:39 +00:00
pv_map.c Allow ALLOC_ANYWHERE to split contiguous areas. 2010-03-25 21:19:26 +00:00
pv_map.h Remove superfluous fn prototypes. 2010-07-09 15:21:10 +00:00
pv.c Append 'm' attribute to pv_attr for missing PVs. 2011-06-29 14:56:33 +00:00
pv.h Defer writing PV labels to vg_write. 2011-06-01 19:29:31 +00:00
raid_manip.c clarify comment 2011-08-19 19:35:50 +00:00
replicator_manip.c Replace free_vg with release_vg 2011-08-10 20:25:29 +00:00
segtype.c Handle metadata with unknown segment types more gracefully. 2009-10-16 17:41:49 +00:00
segtype.h Move the core of the lib/config/config.c functionality into libdevmapper, 2011-08-30 14:55:15 +00:00
snapshot_manip.c Fix potential null ptr deref in 'origin_from_cow' 2011-07-19 16:23:52 +00:00
vg.c Cache and share generated VG structs 2011-08-11 17:24:23 +00:00
vg.h Cache and share generated VG structs 2011-08-11 17:24:23 +00:00