]> sourceware.org Git - lvm2.git/commit
lvconvert --merge @tag support
authorMike Snitzer <snitzer@redhat.com>
Fri, 5 Feb 2010 22:44:37 +0000 (22:44 +0000)
committerMike Snitzer <snitzer@redhat.com>
Fri, 5 Feb 2010 22:44:37 +0000 (22:44 +0000)
commit3e5a54a791f42641aa372d2a2729f56218e04e25
tree89a44bf8f0094029b9097747b31d13c2df6866b6
parentdbfd6e0d1292874df1fca5a5a44e761f7b1561a0
lvconvert --merge @tag support

Switch lvconvert's --merge code over to using process_each_lv().  Doing
so adds support for a single 'lvconvert --merge' to start merging
multiple LVs (which includes @tag expansion).

Add 'lvconvert --merge @tag' testing to test/t-snapshot-merge.sh

Adjust man/lvconvert.8.in to reflect these expanded capabilities.

The lvconvert.c implementation requires rereading the VG each iteration
of process_each_lv().  Otherwise a stale VG instance associated with
the LV passed to lvconvert_single_merge() would result in stale VG
metadata being written back out to disk.  This overwrote new metadata
that was written when a previous snapshot LV finished merging (via
lvconvert_poll).  This is only an issue when merging multiple LVs that
share the same VG (a single VG is typical for most LVM configurations on
system disks).

In the end this new support is very useful for performing a "system
rollback" that requires multiple snapshot LVs be merged to their
respective origin LV.

The yum-utils 'fs-snapshot' plugin tags all snapshot LVs that it creates
with a common 'snapshot_tag' that is unique to the yum transaction.
Rolling back a yum transaction, that created LVM snapshots with the tag
'yum_20100129133223', is as simple as:
  lvconvert --merge @yum_20100129133223

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
man/lvconvert.8.in
test/t-snapshot-merge.sh
tools/lvconvert.c
This page took 0.037671 seconds and 5 git commands to generate.