Skip to contentSkip to conversation

Fix lv-seg relationship on layer removal

PATCH New Jun'ichi Nomura 2 participants 2 messages Feb 21, 2008 – Feb 23, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 Fix lv-seg relationship on layer removal

When a layer is removed, a linear-mapping segment of its parent is discarded and segments of the layer are moved to the parent LV.

To discard the linear-mapping layer properly,
we need to call lv_empty() for the parent to release the layer. Otherwise, the layer LV still has the discarded linear segment in its segs_using_this_lv list.
(Though it might not have any visible effect because the layer
is eventually removed.)

Thanks Milan Broz for finding this bug.

Thanks,

Signature · 8 lines
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: empty-parent-before-layer-removal.patch
Type: text/x-patch
Size: 912 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20080221/146aa820/attachment.bin>
#1 lore raw

PATCH 2/2 Fix lv-seg relationship on layer removal

Quoted 5 lines · Jun'ichi Nomura

When removing a layer, segments are moved from the layer LV to the original LV (parent).
Before doing that, call lv_empty() to cleanup the parent and any relationships.

Quoted 7 lines

Without this, the relationship between the layer_lv and parent remains and lvconvert will fail, for example:

# lvconvert -m-1 vg/lvol0
  LV lvol0_mimagetmp_2 used by LV lvol0:0-511, but is not listed in LV lvol0 segments list.
  Internal error: LV segments corrupted in lvol0_mimagetmp_2.
  intermediate VG write failed.

Hi Jun'ichi,

Would you please consider writing (or just outlining) a test case that fails without yesterday's change, but succeeds with it?

Future maintainers will be grateful :-)