Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2444e830a90fe84721bd6…
Commit: 2444e830a90fe84721bd61f950946eedcbce0af7
Parent: 8810c11bc924e8871f97aa25c61e73b3b3f1fa87
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Jan 30 14:09:21 2020 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Jan 30 14:09:21 2020 -0600
man: updates to lvmcache
---
man/lvmcache.7_main | 99 +++++++++++++++++++++++++++++------------------------
1 file changed, 54 insertions(+), 45 deletions(-)
diff --git a/man/lvmcache.7_main b/man/lvmcache.7_main
index 985b79a..fb91be8 100644
--- a/man/lvmcache.7_main
+++ b/man/lvmcache.7_main
@@ -5,24 +5,32 @@ lvmcache \(em LVM caching
.SH DESCRIPTION
\fBlvm\fP(8) includes two kinds of caching that can be used to improve the
-performance of a Logical Volume (LV). Typically, a smaller, faster device
-is used to improve i/o performance of a larger, slower LV. To do this, a
-separate LV is created from the faster device, and then the original LV is
-converted to start using the fast LV.
+performance of a Logical Volume (LV). When caching, varying subsets of an
+LV's data are temporarily stored on a smaller, faster device (e.g. an SSD)
+to improve the performance of the LV.
+
+To do this with lvm, a new special LV is first created from the faster
+device. This LV will hold the cache. Then, the new fast LV is attached to
+the main LV by way of an lvconvert command. lvconvert inserts one of the
+device mapper caching targets into the main LV's i/o path. The device
+mapper target combines the main LV and fast LV into a hybrid device that looks
+like the main LV, but has better performance. While the main LV is being
+used, portions of its data will be temporarily and transparently stored on
+the special fast LV.
The two kinds of caching are:
.IP \[bu] 2
-A read and write hot-spot cache, using the dm-cache kernel module. This
-cache is slow moving, and adjusts the cache content over time so that the
-most used parts of the LV are kept on the faster device. Both reads and
-writes use the cache. LVM refers to this using the LV type \fBcache\fP.
+A read and write hot-spot cache, using the dm-cache kernel module.
+This cache tracks access patterns and adjusts its content deliberately so
+that commonly used parts of the main LV are likely to be found on the fast
+storage. LVM refers to this using the LV type \fBcache\fP.
.IP \[bu] 2
-A streaming write cache, using the dm-writecache kernel module. This
-cache is intended to be used with SSD or PMEM devices to speed up all
-writes to an LV. Reads do not use this cache. LVM refers to this using
-the LV type \fBwritecache\fP.
+A write cache, using the dm-writecache kernel module. This cache can be
+used with SSD or PMEM devices to speed up all writes to the main LV. Data
+read from the main LV is not stored in the cache, only newly written data.
+LVM refers to this using the LV type \fBwritecache\fP.
.SH USAGE
@@ -30,30 +38,31 @@ Both kinds of caching use similar lvm commands:
.B 1. Identify main LV that needs caching
-A main LV exists on slower devices.
+The main LV may already exist, and is located on larger, slower devices.
+A main LV would be created with a command like:
.nf
- $ lvcreate -n main -L Size vg /dev/slow
+ $ lvcreate -n main -L Size vg /dev/slow_hhd
.fi
.B 2. Identify fast LV to use as the cache
-A fast LV exists on faster devices. This LV will be used to hold the
-cache.
+A fast LV is created using one or more fast devices, like an SSD. This
+special LV will be used to hold the cache:
.nf
- $ lvcreate -n fast -L Size vg /dev/fast
+ $ lvcreate -n fast -L Size vg /dev/fast_ssd
$ lvs -a
LV Attr Type Devices
- fast -wi------- linear /dev/fast
- main -wi------- linear /dev/slow
+ fast -wi------- linear /dev/fast_ssd
+ main -wi------- linear /dev/slow_hhd
.fi
.B 3. Start caching the main LV
-To start caching the main LV using the fast LV, convert the main LV to the
-desired caching type, and specify the fast LV to use:
+To start caching the main LV, convert the main LV to the desired caching
+type, and specify the fast LV to use as the cache:
.nf
using dm-cache:
@@ -83,16 +92,16 @@ using dm-cache:
$ lvs -a
LV Pool Type Devices
main [fast_cvol] cache main_corig(0)
- [fast_cvol] linear /dev/fast
- [main_corig] linear /dev/slow
+ [fast_cvol] linear /dev/fast_ssd
+ [main_corig] linear /dev/slow_hhd
using dm-writecache:
$ lvs -a
LV Pool Type Devices
main [fast_cvol] writecache main_wcorig(0)
- [fast_cvol] linear /dev/fast
- [main_wcorig] linear /dev/slow
+ [fast_cvol] linear /dev/fast_ssd
+ [main_wcorig] linear /dev/slow_hhd
using dm-cache (with cachepool):
@@ -100,9 +109,9 @@ using dm-cache (with cachepool):
LV Pool Type Devices
main [fast_cpool] cache main_corig(0)
[fast_cpool] cache-pool fast_pool_cdata(0)
- [fast_cpool_cdata] linear /dev/fast
- [fast_cpool_cmeta] linear /dev/fast
- [main_corig] linear /dev/slow
+ [fast_cpool_cdata] linear /dev/fast_ssd
+ [fast_cpool_cmeta] linear /dev/fast_ssd
+ [main_corig] linear /dev/slow_hhd
.fi
.B 5. Use the main LV
@@ -120,8 +129,8 @@ attached.
$ lvs -a
LV VG Attr Type Devices
- fast vg -wi------- linear /dev/fast
- main vg -wi------- linear /dev/slow
+ fast vg -wi------- linear /dev/fast_ssd
+ main vg -wi------- linear /dev/slow_hhd
.fi
@@ -137,21 +146,21 @@ attached.
.I LV
.br
-Pass this option a standard LV. With a cachevol, cache data and metadata
-are contained within the single LV. This is used with dm-writecache or
-dm-cache.
+Pass this option a fast LV that should be used to hold the cache. With a
+cachevol, cache data and metadata are stored in different parts of the
+same fast LV. This option can be used with dm-writecache or dm-cache.
.B --cachepool
.IR CachePoolLV | LV
.br
-Pass this option a cache pool object. With a cache pool, lvm places cache
-data and cache metadata on different LVs. The two LVs together are called
-a cache pool. This permits specific placement of data and metadata. A
-cache pool is represented as a special type of LV that cannot be used
-directly. (If a standard LV is passed to this option, lvm will first
-convert it to a cache pool by combining it with another LV to use for
-metadata.) This can be used with dm-cache.
+Pass this option a cachepool LV or a standard LV. When using a cache
+pool, lvm places cache data and cache metadata on different LVs. The two
+LVs together are called a cache pool. This permits specific placement of
+data and metadata. A cache pool is represented as a special type of LV
+that cannot be used directly. If a standard LV is passed with this
+option, lvm will first convert it to a cache pool by combining it with
+another LV to use for metadata. This option can be used with dm-cache.
\&
@@ -267,8 +276,8 @@ LV that references two sub LVs, one for data and one for metadata.
To create a cache pool from two separate LVs:
.nf
-$ lvcreate -n fast -L DataSize vg /dev/fast1
-$ lvcreate -n fastmeta -L MetadataSize vg /dev/fast2
+$ lvcreate -n fast -L DataSize vg /dev/fast_ssd1
+$ lvcreate -n fastmeta -L MetadataSize vg /dev/fast_ssd2
$ lvconvert --type cache-pool --poolmetadata fastmeta vg/fast
.fi
@@ -286,8 +295,8 @@ cache pool LV from the two specified LVs, and use the cache pool to start
caching the main LV.
.nf
-$ lvcreate -n fast -L DataSize vg /dev/fast1
-$ lvcreate -n fastmeta -L MetadataSize vg /dev/fast2
+$ lvcreate -n fast -L DataSize vg /dev/fast_ssd1
+$ lvcreate -n fastmeta -L MetadataSize vg /dev/fast_ssd2
$ lvconvert --type cache --cachepool fast --poolmetadata fastmeta vg/main
.fi
@@ -418,7 +427,7 @@ and metadata LVs, each of the sub-LVs can use raid1.)
.nf
$ lvcreate -n main -L Size vg /dev/slow
-$ lvcreate --type raid1 -m 1 -n fast -L Size vg /dev/fast1 /dev/fast2
+$ lvcreate --type raid1 -m 1 -n fast -L Size vg /dev/ssd1 /dev/ssd2
$ lvconvert --type cache --cachevol fast vg/main
.fi
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=bab3b70e3ae253da39da6…
Commit: bab3b70e3ae253da39da6fb9146ccf428cdb6ab3
Parent: ecb77e9db31c88ed1a53e3194366e642f9b04e5a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jan 20 14:16:13 2020 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jan 23 10:32:15 2020 +0100
tests: add corruption write on PV test
Test a case where PV is readable, but fails on write updating.
Check the failure is reported only for a single PV.
---
test/shell/pv-corruption.sh | 56 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/test/shell/pv-corruption.sh b/test/shell/pv-corruption.sh
new file mode 100644
index 0000000..b3c5059
--- /dev/null
+++ b/test/shell/pv-corruption.sh
@@ -0,0 +1,56 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2020 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# tests, write failer on PV1 is not reporting errors on PV2 or PV3...
+
+SKIP_WITH_LVMLOCKD=1
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+# skip test early if there is no 'delay' target available
+aux target_at_least dm-delay 1 1 0 || skip "missing dm-delay target"
+touch HAVE_DM_DELAY
+
+#
+# Main
+#
+aux prepare_devs 3 20
+
+pvcreate -y --setphysicalvolumesize 10m "$dev1"
+pvcreate "$dev2"
+pvcreate "$dev3"
+
+vgcreate $vg "$dev1" "$dev2" "$dev3"
+
+pvs -o +uuid
+
+# Keep device readable, but any write fails
+aux writeerror_dev "$dev1" 0:100
+
+# Suppose to fail, size PV1 is not writable
+not pvresize "$dev1" 2>&1 | tee out
+
+# Output should not complain about any error on pv2 nor pv3
+not grep pv2 out
+not grep pv3 out
+
+# Restore working PV1 back
+aux enable_dev "$dev1"
+
+# FIXME: Takes a lot of time ATM....
+pvck "$dev2"
+
+pvs -o +uuid
+vgdisplay
+
+vgremove $vg
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ecb77e9db31c88ed1a53e…
Commit: ecb77e9db31c88ed1a53e3194366e642f9b04e5a
Parent: cf844941d4f0939a78a9e0d0e0ef932172e55bfb
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jan 20 13:15:46 2020 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jan 23 10:32:15 2020 +0100
tests: writeerror_dev
Intruduce aux function for easy simulation of disk areas,
that are 'normally' readable, but will fail on write.
---
test/lib/aux.sh | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index ea126de..a9d1fe4 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -516,6 +516,8 @@ teardown() {
echo -n "## teardown..."
unset LVM_LOG_FILE_EPOCH
+ test ! -f ERR_DEV || should dmsetup remove $(cat ERR_DEV_NAME)
+
if test -f TESTNAME ; then
if test ! -f SKIP_THIS_TEST ; then
@@ -954,6 +956,8 @@ common_dev_() {
case "$tgtype" in
delay)
echo "$from $len delay $pvdev $(( pos + offset )) $read_ms $pvdev $(( pos + offset )) $write_ms" ;;
+ writeerror)
+ echo "$from $len delay $pvdev $(( pos + offset )) 0 $(cat ERR_DEV) 0 0" ;;
error|zero)
echo "$from $len $tgtype" ;;
esac
@@ -1082,6 +1086,29 @@ error_dev() {
}
#
+# Convert device to device with write errors but normal reads.
+# For this 'delay' dev is used and reroutes 'reads' back to original device
+# and for writes it will use extra new TEST-errordev (huge error target)
+# i.e. writeerror_dev "$dev1" 8:32
+writeerror_dev() {
+ local name=${PREFIX}-errordev
+
+ if test ! -e ERR_DEV; then
+ # delay target is used for error mapping
+ if test ! -f HAVE_DM_DELAY ; then
+ target_at_least dm-delay 1 1 0 || return 0
+ touch HAVE_DM_DELAY
+ fi
+ dmsetup create -u "TEST-$name" "$name" --table "0 4611686018427387904 error"
+ # Take major:minor of our error device
+ echo "$name" > ERR_DEV_NAME
+ dmsetup info -c --noheadings -o major,minor "$name" > ERR_DEV
+ fi
+
+ common_dev_ writeerror "$@"
+}
+
+#
# Convert existing device to a device with zero segments
# Takes the list of pairs of zero segment from:len
# Combination with error or delay is unsupported
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7078dd01e86b176aa5bcb…
Commit: 7078dd01e86b176aa5bcb964f57db4ba108eeb4e
Parent: d53bfae273677975bd805bfaa3d7e7cd995aaa52
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Jan 22 15:01:00 2020 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jan 22 15:01:00 2020 -0600
man: pvck dump description improvements
---
man/pvck.8_des | 60 +++++++++++++++++++++++++++++++++-------------------------
1 file changed, 34 insertions(+), 26 deletions(-)
diff --git a/man/pvck.8_des b/man/pvck.8_des
index 8e81493..b87345e 100644
--- a/man/pvck.8_des
+++ b/man/pvck.8_des
@@ -1,43 +1,49 @@
pvck checks and repairs LVM metadata on PVs.
-.SS Dump
+.SS Dump options
.B headers
.br
-Print header values and warn if any values are incorrect. Checks the
-label_header, pv_header, mda_header(s), and metadata text.
+Print LVM on-disk headers and structures: label_header, pv_header,
+mda_header(s), and metadata text. Warnings are printed if any values are
+incorrect. The label_header and pv_header both exist in a 512 byte
+sector, usually the second sector of the device. An mda_header exists in
+a 512 byte sector at offset 4096 bytes. A second mda_header can
+optionally exist near the end of the device. The metadata text exists in
+an area (about 1MiB by default) immediately following the mda_header
+sector. The metadata text is checked but not printed (see other options).
.B metadata
.br
-Print or save the current metadata text, using headers to locate the
-metadata. If headers are damaged, the metadata may not be found. Use
---settings "mda_num=2" to look in mda2 (the second mda at the end of the
-device (if used). The metadata text is printed to stdout. With --file,
-the metadata text is saved to a file.
+Print the current LVM VG metadata text (or save to a file), using headers
+to locate the latest copy of metadata. If headers are damaged, metadata
+may not be found (see metadata_search). Use --settings "mda_num=2" to
+look in mda2 (the second mda at the end of the device, if used). The
+metadata text is printed to stdout or saved to a file with --file.
.B metadata_all
.br
-List or save all versions of metadata found in the metadata area, using
-headers to locate the metadata. If headers are damaged, the metadata may
-not be found. Use --settings "mda_num=2" as above. All metadata versions
-are listed (add -v to include descriptions and dates in the listing.)
-With -file, all versions are written to a file.
+List all versions of VG metadata found in the metadata area, using headers
+to locate metadata. Full copies of all metadata are saved to a file with
+the --file option. If headers are damaged, metadata may not be found (see
+metadata_search). Use --settings "mda_num=2" as above. Use -v to include
+descriptions and dates when listing metadata versions.
.B metadata_search
.br
-Search for all versions of metadata in the common locations. This does
-not use headers, so it can find metadata even when headers are damaged.
-Use --settings "mda_num=2" as above. All metadata versions are listed
-(add -v to include descriptions and dates in the listing.) With --file,
-all versions are written to a file. To save one copy of metadata, use
---settings "metadata_offset=<offset>", where the offset is taken from the
-dump listing.
+List all versions of VG metadata found in the metadata area, searching
+common locations so metadata can be found if headers are damaged. Full
+copies of all metadata are saved to a file with the --file option. To
+save one specific version of metadata, use --settings
+"metadata_offset=<offset>", where the offset is taken from the list of
+versions found. Use -v to include descriptions and dates when listing
+metadata versions.
.B metadata_area
.br
Save the entire text metadata area to a file without processing.
-.SS Repair
+.SS Repair options
.B --repair
.br
@@ -55,14 +61,15 @@ VG, it is important for the user to determine the correct PV UUID and
specify it in --settings. Otherwise, the wrong PV UUID could be used if
device names have been swapped since the metadata was last written.
-If a PV had no metadata areas and the pv_header is damaged, then the
+If a PV has no metadata areas and the pv_header is damaged, then the
repair will not know to create no metadata areas during repair. It will
by default repair metadata in mda1. To repair with no metadata areas, use
--settings "mda_offset=0 mda_size=0".
There are cases where repair should be run on all PVs in the VG (using the
same metadata file): if all PVs in the VG are damaged, if using an old
-metadata version, or if a backup file is used instead of raw metadata.
+metadata version, or if a backup file is used instead of raw metadata
+(taken from pvck dump.)
Using --repair is equivalent to running --repairtype pv_header followed by
--repairtype metadata.
@@ -102,9 +109,10 @@ print/save one instance of metadata text.
\fBmda_offset=\fP\fIbytes\fP \fBmda_size=\fP\fIbytes\fP
.br
Refers to a metadata area (mda) location and size. An mda includes an
-mda_header and circular text buffer. Setting this forces metadata_search
-look for metadata in the given area instead of the normal locations. When
-set to zero with repair, it indicates no metadata areas should exist.
+mda_header and circular metadata text buffer. Setting this forces
+metadata_search look for metadata in the given area instead of the
+standard locations. When set to zero with repair, it indicates no
+metadata areas should exist.
\fBmda2_offset=\fP\fIbytes\fP \fBmda2_size=\fP\fIbytes\fP
.br
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a1f06e2faebfbc091b4bb…
Commit: a1f06e2faebfbc091b4bbb900398cda05264c753
Parent: 62888e9c7692443066e90494764791753277f02e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jan 21 17:07:20 2020 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jan 21 17:07:20 2020 +0100
tests: partial revert of test change of b6e6ea2d65785f03f3cee7938be635bcb8ad4944
With the update with commit b6e6ea2d65785f03f3cee7938be635bcb8ad4944
the test file has been updated - however stable branch still has
clvmd & lvmetad so we want to omit runnig unit tests for these runs.
---
test/unit/unit-test.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/test/unit/unit-test.sh b/test/unit/unit-test.sh
index f545f14..e8332d6 100644
--- a/test/unit/unit-test.sh
+++ b/test/unit/unit-test.sh
@@ -13,6 +13,8 @@
SKIP_WITH_LVMLOCKD=1
SKIP_WITH_LVMPOLLD=1
+SKIP_WITH_LVMETAD=1
+SKIP_WITH_CLVMD=1
SKIP_ROOT_DM_CHECK=1
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c66e01569862a421d137e…
Commit: c66e01569862a421d137eedbf9e6abe4e1152853
Parent: 9b41118b9c8fed755eaabb1b0833f2518ddf1c36
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jan 20 14:16:13 2020 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 20 15:21:38 2020 +0100
tests: add corruption write on PV test
Test a case where PV is readable, but fails on write updating.
Check the failure is reported only for a single PV.
---
test/shell/pv-corruption.sh | 52 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/test/shell/pv-corruption.sh b/test/shell/pv-corruption.sh
new file mode 100644
index 0000000..3958ee1
--- /dev/null
+++ b/test/shell/pv-corruption.sh
@@ -0,0 +1,52 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2020 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# tests, write failer on PV1 is not reporting errors on PV2 or PV3...
+
+SKIP_WITH_LVMLOCKD=1
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+#
+# Main
+#
+aux prepare_devs 3 20
+
+pvcreate -y --setphysicalvolumesize 10m "$dev1"
+pvcreate "$dev2"
+pvcreate "$dev3"
+
+vgcreate $vg "$dev1" "$dev2" "$dev3"
+
+pvs -o +uuid
+
+# Keep device readable, but any write fails
+aux writeerror_dev "$dev1" 0:100
+
+# Suppose to fail, size PV1 is not writable
+not pvresize "$dev1" 2>&1 | tee out
+
+# Output should not complain about any error on pv2 nor pv3
+not grep pv2 out
+not grep pv3 out
+
+# Restore working PV1 back
+aux enable_dev "$dev1"
+
+# FIXME: Takes a lot of time ATM....
+pvck "$dev2"
+
+pvs -o +uuid
+vgdisplay
+
+vgremove $vg
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9b41118b9c8fed755eaab…
Commit: 9b41118b9c8fed755eaabb1b0833f2518ddf1c36
Parent: 440ced192a5ae6d5fa7c191981abcdf59926e90b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jan 20 13:15:46 2020 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 20 15:21:38 2020 +0100
tests: writeerror_dev
Intruduce aux function for easy simulation of disk areas,
that are 'normally' readable, but will fail on write.
---
test/lib/aux.sh | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index ec0699f..b90063d 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -564,6 +564,8 @@ teardown() {
echo -n "## teardown..."
unset LVM_LOG_FILE_EPOCH
+ test ! -f ERR_DEV || should dmsetup remove $(cat ERR_DEV_NAME)
+
if test -f TESTNAME ; then
if test ! -f SKIP_THIS_TEST ; then
@@ -985,6 +987,8 @@ common_dev_() {
case "$tgtype" in
delay)
echo "$from $len delay $pvdev $(( pos + offset )) $read_ms $pvdev $(( pos + offset )) $write_ms" ;;
+ writeerror)
+ echo "$from $len delay $pvdev $(( pos + offset )) 0 $(cat ERR_DEV) 0 0" ;;
error|zero)
echo "$from $len $tgtype" ;;
esac
@@ -1125,6 +1129,24 @@ error_dev() {
}
#
+# Convert device to device with write errors but normal reads.
+# For this 'delay' dev is used and reroutes 'reads' back to original device
+# and for writes it will use extra new TEST-errordev (huge error target)
+# i.e. writeerror_dev "$dev1" 8:32
+writeerror_dev() {
+ local name=${PREFIX}-errordev
+
+ if test ! -e ERR_DEV; then
+ dmsetup create -u "TEST-$name" "$name" --table "0 4611686018427387904 error"
+ # Take major:minor of our error device
+ echo "$name" > ERR_DEV_NAME
+ dmsetup info -c --noheadings -o major,minor "$name" > ERR_DEV
+ fi
+
+ common_dev_ writeerror "$@"
+}
+
+#
# Convert existing device to a device with zero segments
# Takes the list of pairs of zero segment from:len
# Combination with error or delay is unsupported
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=440ced192a5ae6d5fa7c1…
Commit: 440ced192a5ae6d5fa7c191981abcdf59926e90b
Parent: d20490f76dd5a82b5fe61adc1c4e8044593e1c98
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Mon Jan 20 14:36:16 2020 +0100
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Mon Jan 20 14:48:58 2020 +0100
base: Get Makefile from master
---
base/Makefile | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/base/Makefile b/base/Makefile
new file mode 100644
index 000000000..056ea5910
--- /dev/null
+++ b/base/Makefile
@@ -0,0 +1,38 @@
+# Copyright (C) 2018 Red Hat, Inc. All rights reserved.
+#
+# This file is part of the device-mapper userspace tools.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU Lesser General Public License v.2.1.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# Uncomment this to build the simple radix tree. You'll need to make clean too.
+# Comment to build the advanced radix tree.
+#base/data-struct/radix-tree.o: CFLAGS += -DSIMPLE_RADIX_TREE
+
+# NOTE: this Makefile only works as 'include' for toplevel Makefile
+# which defined all top_* variables
+
+BASE_SOURCE=\
+ base/data-struct/radix-tree.c
+
+BASE_TARGET = base/libbase.a
+BASE_DEPENDS = $(BASE_SOURCE:%.c=%.d)
+BASE_OBJECTS = $(BASE_SOURCE:%.c=%.o)
+CLEAN_TARGETS += $(BASE_DEPENDS) $(BASE_OBJECTS) \
+ $(BASE_SOURCE:%.c=%.gcda) \
+ $(BASE_SOURCE:%.c=%.gcno) \
+ $(BASE_TARGET)
+
+$(BASE_TARGET): $(BASE_OBJECTS)
+ @echo " [AR] $@"
+ $(Q) $(RM) $@
+ $(Q) $(AR) rsv $@ $(BASE_OBJECTS) > /dev/null
+
+ifeq ("$(DEPENDS)","yes")
+-include $(BASE_DEPENDS)
+endif
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d53bfae273677975bd805…
Commit: d53bfae273677975bd805bfaa3d7e7cd995aaa52
Parent: 2f6d0a6408220a1f6a96a9f39779846578d88b8c
Author: Heming Zhao <heming.zhao(a)suse.com>
AuthorDate: Wed Jan 15 02:44:30 2020 +0000
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jan 15 09:46:54 2020 -0600
add suggestion message for mirror LVs
Currently the error messages are not clear. This very easy to
guide user to execute "--removemissing --force", it is dangerous
and will make the LVs to be destroied.
Signed-off-by: Zhao Heming <heming.zhao(a)suse.com>
---
tools/vgreduce.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/vgreduce.c b/tools/vgreduce.c
index b001ccb..4a4202e 100644
--- a/tools/vgreduce.c
+++ b/tools/vgreduce.c
@@ -67,6 +67,8 @@ static int _consolidate_vg(struct cmd_context *cmd, struct volume_group *vg)
cmd->handles_missing_pvs = 1;
log_error("There are still partial LVs in VG %s.", vg->name);
log_error("To remove them unconditionally use: vgreduce --removemissing --force.");
+ log_error("To remove them unconditionally from mirror LVs use: vgreduce"
+ " --removemissing --mirrorsonly --force.");
log_warn("WARNING: Proceeding to remove empty missing PVs.");
}
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5ccf3e6f30479331b9b47…
Commit: 5ccf3e6f30479331b9b47e0165ed191fbaa38f44
Parent: 7737ffb11ceba0f4220e1dfb79b8e97f20e7b8e9
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jan 6 15:57:08 2020 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 13 17:42:31 2020 +0100
vdo: avoid running initialization of cache pool vars
Since VDO is also pool, the old if() case missed to know about this,
and executed unnecesserily initialization of cache pool variables.
This was usually harmless when using 'smaller' sizes of VDO pools,
but for big VDO pool size, we were reporting senseless messages
about big cache chunk sizes.
---
tools/lvcreate.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index 4a1534c..448f125 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -396,13 +396,15 @@ static int _update_extents_params(struct volume_group *vg,
&lp->discards,
&lp->zero_new_blocks))
return_0;
- } else if (!update_cache_pool_params(vg->cmd, vg->profile, vg->extent_size,
- lp->segtype, lp->target_attr,
- lp->extents,
- &lp->pool_metadata_extents,
- &lp->thin_chunk_size_calc_policy,
- &lp->chunk_size))
- return_0;
+ } else if (segtype_is_cache_pool(lp->segtype) || segtype_is_cache(lp->segtype)) {
+ if (!update_cache_pool_params(vg->cmd, vg->profile, vg->extent_size,
+ lp->segtype, lp->target_attr,
+ lp->extents,
+ &lp->pool_metadata_extents,
+ &lp->thin_chunk_size_calc_policy,
+ &lp->chunk_size))
+ return_0;
+ }
if (lcp->percent == PERCENT_FREE || lcp->percent == PERCENT_PVS) {
if (lp->extents <= (2 * lp->pool_metadata_extents)) {
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7737ffb11ceba0f4220e1…
Commit: 7737ffb11ceba0f4220e1dfb79b8e97f20e7b8e9
Parent: dad2660a387ed32dc8146b497d279089c1ce48ed
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jan 13 17:27:24 2020 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 13 17:42:31 2020 +0100
raid: disallow reshape of stacked LVs
Until we resolve reshape for 'stacked' devices, we need to disable it.
So users can no longer reshape i.e. thin-pool data volumes, causing
ATM bad thin-pool problems.
---
lib/metadata/raid_manip.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index a1c51aa..4855039 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -6438,6 +6438,12 @@ int lv_raid_convert(struct logical_volume *lv,
uint32_t available_slvs, removed_slvs;
takeover_fn_t takeover_fn;
+ /* FIXME Can't reshape volume in use - aka not toplevel devices */
+ if (!dm_list_empty(&lv->segs_using_this_lv)) {
+ log_error("Can't reshape stacked volume %s.", display_lvname(lv));
+ return 0;
+ }
+
/* FIXME If not active, prompt and activate */
/* FIXME Some operations do not require the LV to be active */
/* LV must be active to perform raid conversion operations */
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c575c1c9ff71d95b6af0e…
Commit: c575c1c9ff71d95b6af0ec75798dd597491ca0b8
Parent: 36210c2b491424d7a0ab27d0a65effd6fc6ecc4c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jan 6 15:57:08 2020 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 13 17:41:22 2020 +0100
vdo: avoid running initialization of cache pool vars
Since VDO is also pool, the old if() case missed to know about this,
and executed unnecesserily initialization of cache pool variables.
This was usually harmless when using 'smaller' sizes of VDO pools,
but for big VDO pool size, we were reporting senseless messages
about big cache chunk sizes.
---
tools/lvcreate.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index c27b798..4be8e03 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -395,13 +395,15 @@ static int _update_extents_params(struct volume_group *vg,
&lp->discards,
&lp->zero_new_blocks))
return_0;
- } else if (!update_cache_pool_params(vg->cmd, vg->profile, vg->extent_size,
- lp->segtype, lp->target_attr,
- lp->extents,
- &lp->pool_metadata_extents,
- &lp->thin_chunk_size_calc_policy,
- &lp->chunk_size))
- return_0;
+ } else if (segtype_is_cache_pool(lp->segtype) || segtype_is_cache(lp->segtype)) {
+ if (!update_cache_pool_params(vg->cmd, vg->profile, vg->extent_size,
+ lp->segtype, lp->target_attr,
+ lp->extents,
+ &lp->pool_metadata_extents,
+ &lp->thin_chunk_size_calc_policy,
+ &lp->chunk_size))
+ return_0;
+ }
if (lcp->percent == PERCENT_FREE || lcp->percent == PERCENT_PVS) {
if (lp->extents <= (2 * lp->pool_metadata_extents)) {
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=36210c2b491424d7a0ab2…
Commit: 36210c2b491424d7a0ab27d0a65effd6fc6ecc4c
Parent: 50c56ade2a7a89f751091669fb8b31854f93eff1
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jan 13 17:27:24 2020 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 13 17:41:22 2020 +0100
raid: disallow reshape of stacked LVs
Until we resolve reshape for 'stacked' devices, we need to disable it.
So users can no longer reshape i.e. thin-pool data volumes, causing
ATM bad thin-pool problems.
---
lib/metadata/raid_manip.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 9030261..548faf1 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -6444,6 +6444,12 @@ int lv_raid_convert(struct logical_volume *lv,
uint32_t available_slvs, removed_slvs;
takeover_fn_t takeover_fn;
+ /* FIXME Can't reshape volume in use - aka not toplevel devices */
+ if (!dm_list_empty(&lv->segs_using_this_lv)) {
+ log_error("Can't reshape stacked volume %s.", display_lvname(lv));
+ return 0;
+ }
+
/* FIXME If not active, prompt and activate */
/* FIXME Some operations do not require the LV to be active */
/* LV must be active to perform raid conversion operations */