]> sourceware.org Git - lvm2.git/commit
lvmcache: process duplicate PVs directly
authorDavid Teigland <teigland@redhat.com>
Thu, 11 Feb 2016 18:37:36 +0000 (12:37 -0600)
committerDavid Teigland <teigland@redhat.com>
Fri, 6 May 2016 14:00:00 +0000 (09:00 -0500)
commitd3d13e134af15611c3f12107aa1627b12110a974
tree2091603a65b29199adfdc835c5c6a5865ce1e3a7
parent8b7a78c728be3b9af698dae9344d01752c4cf615
lvmcache: process duplicate PVs directly

Previously, duplicate PVs were processed as a side effect
of processing the "chosen" PV in lvmcache.  The duplicate
PV would be hacked into lvmcache temporarily in place of
the chosen PV.

In the old way, we had to always process the "chosen" PV
device, even if a duplicate of it was named on the command
line.  This meant we were processing a different device than
was asked for.  This could be worked around by naming
multiple duplicate devs on the command line in which case
they were swapped in and out of lvmcache for processing.

Now, the duplicate devs are processed directly in their
own processing loop.  This means we can remove the old
hacks related to processing dups as a side effect of
processing the chosen device.  We can now simply process
the device that was named on the command line.

When the same PVID exists on two or more devices, one device
is preferred and used in the VG, and the others are duplicates
and are not used in the VG.  The preferred device exists in
lvmcache as usual.  The duplicates exist in a specical list
of unused duplicate devices.

The duplicate devs have the "d" attribute and the "duplicate"
reporting field displays "duplicate" for them.

'pvs' warns about duplicates, but the formal output only
includes the single preferred PV.

'pvs -a' has the same warnings, and the duplicate devs are
included in the output.

'pvs <path>' has the same warnings, and displays the named
device, whether it is preferred or a duplicate.
lib/cache/lvmcache.c
lib/cache/lvmcache.h
tools/commands.h
tools/pvchange.c
tools/toollib.c
tools/tools.h
This page took 0.039173 seconds and 5 git commands to generate.