1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 11:55:55 +03:00
lvm2/lib
Jonathan Earl Brassow da23255cc9 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
..
activate Move the core of the lib/config/config.c functionality into libdevmapper, 2011-08-30 14:55:15 +00:00
cache Use size_t return type 2011-09-01 10:25:22 +00:00
commands Keep the old-style prototypes 2011-09-01 13:25:50 +00:00
config Replace const usage of dm_config_find_node with more appropriate value-lookup 2011-08-31 15:19:19 +00:00
datastruct Revert the #include changes. Need to fix this at the #include site for now, and 2011-07-18 14:34:33 +00:00
device Move the core of the lib/config/config.c functionality into libdevmapper, 2011-08-30 14:55:15 +00:00
display Fix some compile warnings on RHEL5 2011-03-01 20:17:56 +00:00
error Add lv_activate_opts structure 2011-06-17 14:14:19 +00:00
filters Move the core of the lib/config/config.c functionality into libdevmapper, 2011-08-30 14:55:15 +00:00
format1 Defer writing PV labels to vg_write. 2011-06-01 19:29:31 +00:00
format_pool Replace free_vg with release_vg 2011-08-10 20:25:29 +00:00
format_text Use size_t return type 2011-09-01 10:25:22 +00:00
freeseg Replace malloc with zalloc when creating segment_type's 2011-03-25 21:59:42 +00:00
label Report sector containing label in verbose message. 2011-06-01 15:30:36 +00:00
locking Move the core of the lib/config/config.c functionality into libdevmapper, 2011-08-30 14:55:15 +00:00
log Trivial, add void to ignore dm_snprinf result 2011-08-11 19:21:42 +00:00
metadata Fix for bug 732142: Unsafe table load during mirror image split 2011-09-01 19:22:11 +00:00
mirror Replace const usage of dm_config_find_node with more appropriate value-lookup 2011-08-31 15:19:19 +00:00
misc Match the prototype old-style declaration 2011-09-01 13:30:11 +00:00
mm Move the core of the lib/config/config.c functionality into libdevmapper, 2011-08-30 14:55:15 +00:00
raid Replace const usage of dm_config_find_node with more appropriate value-lookup 2011-08-31 15:19:19 +00:00
replicator Move the core of the lib/config/config.c functionality into libdevmapper, 2011-08-30 14:55:15 +00:00
report Remove meaningless const type qualifiers on cast type 2011-08-04 14:30:51 +00:00
snapshot Move the core of the lib/config/config.c functionality into libdevmapper, 2011-08-30 14:55:15 +00:00
striped Replace const usage of dm_config_find_node with more appropriate value-lookup 2011-08-31 15:19:19 +00:00
thin Reflect dm_config API update 2011-09-01 10:16:32 +00:00
unknown Move the core of the lib/config/config.c functionality into libdevmapper, 2011-08-30 14:55:15 +00: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 Add lv_activate_opts structure 2011-06-17 14:14:19 +00:00
Makefile.in Initial code layout for thin provisioning target 2011-08-24 08:27:49 +00:00