]> sourceware.org Git - lvm2.git/commit
Fix for bug 732142: Unsafe table load during mirror image split
authorJonathan Earl Brassow <jbrassow@redhat.com>
Thu, 1 Sep 2011 19:22:11 +0000 (19:22 +0000)
committerJonathan Earl Brassow <jbrassow@redhat.com>
Thu, 1 Sep 2011 19:22:11 +0000 (19:22 +0000)
commitda23255cc95ff501ac3a4990160c0ad01c88cdae
treed6419973c2be377c2842355b0a5dc0a48808a079
parent79b9c65b6b0f7791165615a8686b7f19b2ed7f30
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>
WHATS_NEW
lib/metadata/mirror.c
This page took 0.030218 seconds and 5 git commands to generate.