Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4454a580dfd966d0…
Commit: 4454a580dfd966d0cd132a2fd7d0cbb0df7e46a6
Parent: 03621692774e33357acc11ad23d4c8d1faffe971
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Fri May 30 17:26:10 2014 -0500
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Fri May 30 17:26:10 2014 -0500
test: use direct I/O when injecting bad data into RAID images
When directly corrupting RAID images for the purpose of testing,
we must use direct I/O (or a 'sync' after the 'dd') to ensure that
the writes are not caught in the buffer cache in a way that is not
reachable by the top-level RAID device.
---
test/shell/lvchange-syncaction-raid.sh | 16 +++++-----------
1 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/test/shell/lvchange-syncaction-raid.sh b/test/shell/lvchange-syncaction-raid.sh
index a27b885..b5fdfb4 100644
--- a/test/shell/lvchange-syncaction-raid.sh
+++ b/test/shell/lvchange-syncaction-raid.sh
@@ -13,7 +13,10 @@
. lib/test
-aux have_raid 1 5 0 || skip
+# Proper mismatch count 1.5.2+ upstream, 1.3.5 < x < 1.4.0 in RHEL6
+aux have_raid 1 3 5 &&
+ ! aux have_raid 1 4 0 ||
+ aux have_raid 1 5 2 || skip
aux prepare_vg 3
lvcreate -n $lv1 $vg -l1 --type raid1
@@ -22,16 +25,7 @@ START=$(get pv_field "$dev2" pe_start --units 1k)
METASIZE=$(get lv_field $vg/${lv1}_rmeta_1 size -a --units 1k)
SEEK=$((${START%\.00k} + ${METASIZE%\.00k}))
# Overwrite some portion of _rimage_1
-dd if=/dev/urandom of="$dev2" bs=1K count=1 seek=$SEEK
-
-lvchange --syncaction check $vg/$lv1
-
-# hmmm it's still in 'dd' buffer and not on real disk ??
-# anyway skip over with 'should'
-should check lv_field $vg/$lv1 raid_mismatch_count "128"
-
-# Ensure it's all on disk now
-sync
+dd if=/dev/urandom of="$dev2" bs=1K count=1 seek=$SEEK oflag=direct
lvchange --syncaction check $vg/$lv1
check lv_field $vg/$lv1 raid_mismatch_count "128"
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=03621692774e3335…
Commit: 03621692774e33357acc11ad23d4c8d1faffe971
Parent: 442820aae3648e1846417d1248fa36030eba4bd8
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri May 30 17:23:54 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri May 30 17:24:07 2014 +0200
report: fix report field type for lv_kernel_major/minor
Should be defined as numeric field, not string field.
---
lib/report/columns.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/report/columns.h b/lib/report/columns.h
index 93b5575..7c36d10 100644
--- a/lib/report/columns.h
+++ b/lib/report/columns.h
@@ -36,8 +36,8 @@ FIELD(LVS, lv, STR, "Active", lvid, 6, lvactive, lv_active, "Active state of the
FIELD(LVS, lv, NUM, "Maj", major, 3, int32, lv_major, "Persistent major number or -1 if not persistent.", 0)
FIELD(LVS, lv, NUM, "Min", minor, 3, int32, lv_minor, "Persistent minor number or -1 if not persistent.", 0)
FIELD(LVS, lv, NUM, "Rahead", lvid, 6, lvreadahead, lv_read_ahead, "Read ahead setting in current units.", 0)
-FIELD(LVS, lv, STR, "KMaj", lvid, 4, lvkmaj, lv_kernel_major, "Currently assigned major number or -1 if LV is not active.", 0)
-FIELD(LVS, lv, STR, "KMin", lvid, 4, lvkmin, lv_kernel_minor, "Currently assigned minor number or -1 if LV is not active.", 0)
+FIELD(LVS, lv, NUM, "KMaj", lvid, 4, lvkmaj, lv_kernel_major, "Currently assigned major number or -1 if LV is not active.", 0)
+FIELD(LVS, lv, NUM, "KMin", lvid, 4, lvkmin, lv_kernel_minor, "Currently assigned minor number or -1 if LV is not active.", 0)
FIELD(LVS, lv, NUM, "KRahead", lvid, 7, lvkreadahead, lv_kernel_read_ahead, "Currently-in-use read ahead setting in current units.", 0)
FIELD(LVS, lv, NUM, "LSize", size, 5, size64, lv_size, "Size of LV in current units.", 0)
FIELD(LVS, lv, NUM, "MSize", lvid, 6, lvmetadatasize, lv_metadata_size, "For thin pools, the size of the LV that holds the metadata.", 0)
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=442820aae3648e18…
Commit: 442820aae3648e1846417d1248fa36030eba4bd8
Parent: 8212dac849e5a820c579c06a1b2805e7934a8d8b
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Wed May 28 10:17:15 2014 -0500
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Wed May 28 10:17:15 2014 -0500
activation: Remove empty DM device when table fails to load.
As part of better error handling, remove DM devices that have been
sucessfully created but failed to load a table. This can happen
when pvmove'ing in a cluster and the cluster mirror daemon is not
running on a remote node - the mapping table failing to load as a
result. In this case, any revert would work on other nodes running
cmirrord because the DM devices on those nodes did succeed in loading.
However, because no table was able to load on the non-cmirrord nodes,
there is no table present that points to what needs to be reverted.
This causes the empty DM device to remain on the system without being
present in any LVM representation.
This patch should only be considered a partial fix to the overall
problem. This is because only the device which failed to load a
table is removed. Any LVs that may have been loaded as requirements
to the DM device that failed to load may be left in place. Complete
clean-up will require tracking those devices which have been created
as dependencies and removing them along with the device that failed
to load a table.
---
libdm/libdm-deptree.c | 59 ++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 53 insertions(+), 6 deletions(-)
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
index 0a53755..f34c40f 100644
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
@@ -1920,15 +1920,50 @@ static int _create_node(struct dm_tree_node *dnode)
if (!dm_task_no_open_count(dmt))
log_error("Failed to disable open_count");
- if ((r = dm_task_run(dmt)))
- r = dm_task_get_info(dmt, &dnode->info);
-
+ if ((r = dm_task_run(dmt))) {
+ if (!(r = dm_task_get_info(dmt, &dnode->info)))
+ /*
+ * This should not be possible to occur. However,
+ * we print an error message anyway for the more
+ * absurd cases (e.g. memory corruption) so there
+ * is never any question as to which one failed.
+ */
+ log_error(INTERNAL_ERROR
+ "Unable to get DM task info for %s.",
+ dnode->name);
+ }
out:
dm_task_destroy(dmt);
return r;
}
+/*
+ * _remove_node
+ *
+ * This function is only used to remove a DM device that has failed
+ * to load any table.
+ */
+static int _remove_node(struct dm_tree_node *dnode)
+{
+ if (!dnode->info.exists)
+ return 1;
+
+ if (dnode->info.live_table || dnode->info.inactive_table) {
+ log_error(INTERNAL_ERROR
+ "_remove_node called on device with loaded table(s).");
+ return 0;
+ }
+
+ if (!_deactivate_node(dnode->name, dnode->info.major, dnode->info.minor,
+ &dnode->dtree->cookie, dnode->udev_flags, 0)) {
+ log_error("Failed to clean-up device with no table: %s %u:%u",
+ dnode->name ? dnode->name : "",
+ dnode->info.major, dnode->info.minor);
+ return 0;
+ }
+ return 1;
+}
static int _build_dev_string(char *devbuf, size_t bufsize, struct dm_tree_node *node)
{
@@ -2662,7 +2697,7 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
const char *uuid_prefix,
size_t uuid_prefix_len)
{
- int r = 1;
+ int r = 1, node_created = 0;
void *handle = NULL;
struct dm_tree_node *child;
struct dm_info newinfo;
@@ -2684,13 +2719,25 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
return_0;
/* FIXME Cope if name exists with no uuid? */
- if (!child->info.exists && !_create_node(child))
+ if (!child->info.exists && !(node_created = _create_node(child)))
return_0;
if (!child->info.inactive_table &&
child->props.segment_count &&
- !_load_node(child))
+ !_load_node(child)) {
+ /*
+ * If the table load does not succeed, we remove the
+ * device in the kernel that would otherwise have an
+ * empty table. This makes the create + load of the
+ * device atomic. However, if other dependencies have
+ * already been created and loaded; this code is
+ * insufficient to remove those - only the node
+ * encountering the table load failure is removed.
+ */
+ if (node_created && !_remove_node(child))
+ return_0;
return_0;
+ }
/* Propagate device size change change */
if (child->props.size_changed)
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8212dac849e5a820…
Commit: 8212dac849e5a820c579c06a1b2805e7934a8d8b
Parent: 2adaef82722ec71620a6d02c6c973d3472d705ae
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed May 28 15:41:06 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed May 28 15:41:06 2014 +0200
tests: rename test
---
test/shell/lvmetad-same-uuid.sh | 27 ---------------------------
test/shell/pv-duplicate-uuid.sh | 28 ++++++++++++++++++++++++++++
2 files changed, 28 insertions(+), 27 deletions(-)
diff --git a/test/shell/lvmetad-same-uuid.sh b/test/shell/lvmetad-same-uuid.sh
deleted file mode 100644
index 34cc8eb..0000000
--- a/test/shell/lvmetad-same-uuid.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2014 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-. lib/test
-
-aux prepare_devs 3
-
-pvcreate "$dev1"
-UUID1=$(get pv_field "$dev1" uuid)
-pvcreate --config "devices{filter=[\"a|$dev2|\",\"r|.*|\"]}" -u "$UUID1" --norestorefile "$dev2"
-pvcreate --config "devices{filter=[\"a|$dev3|\",\"r|.*|\"]}" -u "$UUID1" --norestorefile "$dev3"
-
-pvs -o+uuid |& tee out
-COUNT=$(should grep --count "Found duplicate" out)
-
-# FIXME lvmetad is not able to serve properly this case
-should [ "$COUNT" -eq 2 ]
-
-pvs -o+uuid --config "devices{filter=[\"a|$dev2|\",\"r|.*|\"]}"
diff --git a/test/shell/pv-duplicate-uuid.sh b/test/shell/pv-duplicate-uuid.sh
new file mode 100644
index 0000000..cc5f56b
--- /dev/null
+++ b/test/shell/pv-duplicate-uuid.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+# Copyright (C) 2014 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# Test 'Found duplicate' is shown
+. lib/test
+
+aux prepare_devs 3
+
+pvcreate "$dev1"
+UUID1=$(get pv_field "$dev1" uuid)
+pvcreate --config "devices{filter=[\"a|$dev2|\",\"r|.*|\"]}" -u "$UUID1" --norestorefile "$dev2"
+pvcreate --config "devices{filter=[\"a|$dev3|\",\"r|.*|\"]}" -u "$UUID1" --norestorefile "$dev3"
+
+pvs -o+uuid |& tee out
+COUNT=$(should grep --count "Found duplicate" out)
+
+# FIXME lvmetad is not able to serve properly this case
+should [ "$COUNT" -eq 2 ]
+
+pvs -o+uuid --config "devices{filter=[\"a|$dev2|\",\"r|.*|\"]}"
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2adaef82722ec716…
Commit: 2adaef82722ec71620a6d02c6c973d3472d705ae
Parent: 171a668e81d9c647677465f042775722a35c5a6e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed May 28 15:27:14 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed May 28 15:33:41 2014 +0200
revert: restore original timeout
Accidently it's been commited - but it has also shown,
that on heavy loaded systems (like our test machine could be)
slightly bigger timeouts which waits longer for udev rules
processing does help and avoids occasional refuse of deactivation
because device is still being open.
(i.e. lvcreate...; lvchange -an...)
Unsure how we could now synchronize for this. On very slow(/loaded)
system 5 second timeout is simply not enough.
TODO: introduce at least lvm.conf configurable setting to
allow longer 'retry' loops.
---
lib/activate/activate.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 7ad3654..41d74c7 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -726,7 +726,7 @@ int lv_check_not_in_use(struct cmd_context *cmd, struct logical_volume *lv,
return 0;
}
- usleep(OPEN_COUNT_CHECK_USLEEP_DELAY * 4);
+ usleep(OPEN_COUNT_CHECK_USLEEP_DELAY);
log_debug_activation("Retrying open_count check for %s/%s.",
lv->vg->name, lv->name);
if (!lv_info(cmd, lv, 0, info, 1, 0)) {
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=171a668e81d9c647…
Commit: 171a668e81d9c647677465f042775722a35c5a6e
Parent: ba3e6e7c323a48b64720f7a182d5c8eca0a5613c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed May 28 15:24:41 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed May 28 15:33:41 2014 +0200
tests: dd needs to hit disk
Unsure if this is feature or bug of syncaction,
but it needs to be present physically on the media
and it ignores content of buffer cache...
(maybe lvchange should implicitely fsync all disks
that are members of raid array before starting test??)
---
test/shell/lvchange-raid.sh | 17 +----------------
1 files changed, 1 insertions(+), 16 deletions(-)
diff --git a/test/shell/lvchange-raid.sh b/test/shell/lvchange-raid.sh
index 209e094..a229154 100644
--- a/test/shell/lvchange-raid.sh
+++ b/test/shell/lvchange-raid.sh
@@ -157,22 +157,7 @@ run_syncaction_check() {
# Overwrite the last half of one of the PVs with crap
dd if=/dev/urandom of="$device" bs=1k count=$size seek=$seek
-
- if [ -n "$THIN_POSTFIX" ]; then
- #
- # Seems to work fine on real devices,
- # but can't make the system notice the bad blocks
- # in the testsuite - especially when thin is layered
- # on top of RAID. In other cases, I can deactivate
- # and reactivate and it works. Here, even that doesn't
- # work.
- return 0
- lvchange -an $vg/$2
- lvchange -ay $vg/$2
- else
- lvchange -an $vg/$lv
- lvchange -ay $vg/$lv
- fi
+ sync
# "check" should find discrepancies but not change them
# 'lvs' should show results
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ba3e6e7c323a48b6…
Commit: ba3e6e7c323a48b64720f7a182d5c8eca0a5613c
Parent: a67774c1fa315e248504a51804cef9f9bc709b2e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed May 28 15:23:46 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed May 28 15:33:41 2014 +0200
tests: raid syncaction activation race
Demonstrace problem of syncaction being called right after activation.
---
test/shell/lvchange-syncaction-raid.sh | 63 ++++++++++++++++++++++++++++++++
1 files changed, 63 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvchange-syncaction-raid.sh b/test/shell/lvchange-syncaction-raid.sh
new file mode 100644
index 0000000..a27b885
--- /dev/null
+++ b/test/shell/lvchange-syncaction-raid.sh
@@ -0,0 +1,63 @@
+#!/bin/sh
+# Copyright (C) 2014 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# test activation race for raid's --syncaction check
+
+. lib/test
+
+aux have_raid 1 5 0 || skip
+aux prepare_vg 3
+
+lvcreate -n $lv1 $vg -l1 --type raid1
+
+START=$(get pv_field "$dev2" pe_start --units 1k)
+METASIZE=$(get lv_field $vg/${lv1}_rmeta_1 size -a --units 1k)
+SEEK=$((${START%\.00k} + ${METASIZE%\.00k}))
+# Overwrite some portion of _rimage_1
+dd if=/dev/urandom of="$dev2" bs=1K count=1 seek=$SEEK
+
+lvchange --syncaction check $vg/$lv1
+
+# hmmm it's still in 'dd' buffer and not on real disk ??
+# anyway skip over with 'should'
+should check lv_field $vg/$lv1 raid_mismatch_count "128"
+
+# Ensure it's all on disk now
+sync
+
+lvchange --syncaction check $vg/$lv1
+check lv_field $vg/$lv1 raid_mismatch_count "128"
+
+# Let's deactivate
+lvchange -an $vg/$lv1
+
+# Slow down write by 100ms
+aux delay_dev "$dev2" 0 100
+lvchange -ay $vg/$lv1
+# noone has it open and target is read & running
+dmsetup info -c
+
+#sleep 10 < "$DM_DEV_DIR/$vg/$lv1" &
+# "check" should find discrepancies but not change them
+# 'lvs' should show results
+
+# FIXME
+# this looks like some race with 'write' during activation
+# and syncaction...
+# For now it fails with:
+# device-mapper: message ioctl on failed: Device or resource busy
+#
+lvchange --syncaction check $vg/$lv1
+
+aux enable_dev "$dev2"
+lvs -o+raid_mismatch_count -a $vg
+
+vgremove -ff $vg
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a67774c1fa315e24…
Commit: a67774c1fa315e248504a51804cef9f9bc709b2e
Parent: 9240aca369e210dddb3435433a3c9ac4fe35d357
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue May 27 16:51:57 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue May 27 17:09:05 2014 +0200
tests: detect same uuid on PV
Check we know how to handle same UUID
Test currently does NOT work on lvmetad
(or it's unclear it even should - thus test error
is currently lowered to 'test warning')
TODO: replace lib/test with a better shell script name
---
test/shell/lvmetad-same-uuid.sh | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvmetad-same-uuid.sh b/test/shell/lvmetad-same-uuid.sh
new file mode 100644
index 0000000..34cc8eb
--- /dev/null
+++ b/test/shell/lvmetad-same-uuid.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Copyright (C) 2014 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+. lib/test
+
+aux prepare_devs 3
+
+pvcreate "$dev1"
+UUID1=$(get pv_field "$dev1" uuid)
+pvcreate --config "devices{filter=[\"a|$dev2|\",\"r|.*|\"]}" -u "$UUID1" --norestorefile "$dev2"
+pvcreate --config "devices{filter=[\"a|$dev3|\",\"r|.*|\"]}" -u "$UUID1" --norestorefile "$dev3"
+
+pvs -o+uuid |& tee out
+COUNT=$(should grep --count "Found duplicate" out)
+
+# FIXME lvmetad is not able to serve properly this case
+should [ "$COUNT" -eq 2 ]
+
+pvs -o+uuid --config "devices{filter=[\"a|$dev2|\",\"r|.*|\"]}"
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=965592340d04f020…
Commit: 965592340d04f02096b800107591290c1ad44443
Parent: 3cb2658fb7ff0bba45e66e79bce8812c819dff52
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon May 26 22:55:31 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon May 26 22:57:20 2014 +0200
man: cleanup dmsetup
Add few bold texts.
---
man/dmsetup.8.in | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/man/dmsetup.8.in b/man/dmsetup.8.in
index ae84489..9a738fb 100644
--- a/man/dmsetup.8.in
+++ b/man/dmsetup.8.in
@@ -426,11 +426,11 @@ that contain a version of device-mapper prior to 4.8.0.
In this case the device will be deleted when its open_count
drops to zero. From version 4.8.0 onwards, if a device can't
be removed because an uninterruptible process is waiting for
-I/O to return from it, adding \-\-force will replace the table
+I/O to return from it, adding \fB\-\-force\fP will replace the table
with one that fails all I/O, which might allow the
process to be killed. If an attempt to remove a device fails,
perhaps because a process run from a quick udev rule
-temporarily opened the device, the \-\-retry option will cause
+temporarily opened the device, the \fB\-\-retry\fP option will cause
the operation to be retried for a few seconds before failing.
Do NOT combine \fB\-\-force\fP and \fB\-\-udevcookie\fP,
as udev may start to process udev rules in the middle of error target
@@ -443,7 +443,7 @@ replacement and result in nondeterministic result.
Attempts to remove all device definitions i.e. reset the driver.
Use with care! From version 4.8.0 onwards, if devices can't
be removed because uninterruptible processes are waiting for
-I/O to return from them, adding \-\-force will replace the table
+I/O to return from them, adding \fB\-\-force\fP will replace the table
with one that fails all I/O, which might allow the
process to be killed. This also runs \fBmknodes\fP afterwards.
.br
@@ -494,7 +494,7 @@ Default subsystem is LVM.
.RI [ device_name ]
.br
Outputs status information for each of the device's targets.
-With \-\-target, only information relating to the specified target type
+With \fB\-\-target\fP, only information relating to the specified target type
any is displayed. With \fB\-\-noflush\fP, the thin target (from version 1.3.0)
doesn't commit any outstanding changes to disk before reporting its statistics.
.br
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3cb2658fb7ff0bba…
Commit: 3cb2658fb7ff0bba45e66e79bce8812c819dff52
Parent: 6e9105c7bb7f4a1beb34579303670e4510c7d2e6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon May 26 22:51:04 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon May 26 22:56:30 2014 +0200
dmsetup: add warning
Warn when --udevcookie/DM_UDEV_COOKIE is used with 'dmsetup remove --force'.
When command is doing multiple ioctl operations on a single device,
it may invoke udev activity, that is colliding with further ioctl commands.
The result of such operation becomes unpredictable.
Use of --retry could partially help...
---
WHATS_NEW_DM | 1 +
man/dmsetup.8.in | 6 ++++++
tools/dmsetup.c | 10 +++++++++-
3 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 6304ff6..8e221c1 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.88 -
=================================
+ Warn user about incorrect use of cookie with 'dmsetup remove --force'.
Also recognize 'help'/'?' as reserved sort key name to show help.
Export recognized DM_REPORT_FIELD_RESERVED_NAME_{HELP,HELP_ALT} to show help.
Add dm_units_to_factor for size unit parsing.
diff --git a/man/dmsetup.8.in b/man/dmsetup.8.in
index 599c843..ae84489 100644
--- a/man/dmsetup.8.in
+++ b/man/dmsetup.8.in
@@ -243,6 +243,9 @@ Specify a one-line table directly on the command line.
.TP
.B \-\-udevcookie \fIcookie
Use cookie for udev synchronisation.
+Note: Same cookie should be used for same type of operations i.e. creation of
+multiple different devices. It's not adviced to combine different
+operations on the single device.
.TP
.BR \-u | \-\-uuid
Specify the uuid.
@@ -429,6 +432,9 @@ process to be killed. If an attempt to remove a device fails,
perhaps because a process run from a quick udev rule
temporarily opened the device, the \-\-retry option will cause
the operation to be retried for a few seconds before failing.
+Do NOT combine \fB\-\-force\fP and \fB\-\-udevcookie\fP,
+as udev may start to process udev rules in the middle of error target
+replacement and result in nondeterministic result.
.br
.HP
.B remove_all
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 4433571..f84d1a8 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -1498,8 +1498,16 @@ error:
static int _remove(CMD_ARGS)
{
- if (_switches[FORCE_ARG] && argc > 1)
+ if (_switches[FORCE_ARG] && argc > 1) {
+ /*
+ * 'remove --force' option is doing 2 operations on the same device
+ * this is not compatible with the use of --udevcookie/DM_UDEV_COOKIE.
+ * Udevd collision could be partially avoided with --retry.
+ */
+ if (_udev_cookie)
+ log_warn("WARNING: Use of cookie and --force is not compatible.");
(void) _error_device(cmd, argc, argv, NULL, 0);
+ }
return _simple(DM_DEVICE_REMOVE, argc > 1 ? argv[1] : NULL, 0, 0);
}
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1c4fe47308e3638b…
Commit: 1c4fe47308e3638b95f042a1efc942c5ce8e4fdc
Parent: b2da0f0a5b5b99c10c2ea531b63a3d9466eb1832
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu May 22 09:56:44 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu May 22 10:00:19 2014 +0200
lvm_init: don't use name mangling for LVM
LVM has restricter character set that is allowed for VG-LV names
and the dm names constructed do not contain any blacklisted characters
that would require name mangling.
Also, when any other device-mapper device is scanned that could
possibly contain such blacklisted characters, we reference the
device by its major:minor instead of dm name (e.g. _device_is_usable fn).
---
WHATS_NEW | 1 +
liblvm/lvm_base.c | 7 +++++++
tools/lvmcmdline.c | 7 +++++++
3 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 61753d6..491dece 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.107 -
==================================
+ Don't use name mangling for LVM - it never uses dm names with wrong char set.
Remove default.profile and add {command,metadata}_profile_template.profile.
Use proper umask for systemd units generated by lvm2-activation-generator.
Check for failing mirror_remove_missing() function.
diff --git a/liblvm/lvm_base.c b/liblvm/lvm_base.c
index 2a373ba..47ad241 100644
--- a/liblvm/lvm_base.c
+++ b/liblvm/lvm_base.c
@@ -35,6 +35,13 @@ static lvm_t _lvm_init(const char *system_dir)
if (!udev_init_library_context())
stack;
+ /*
+ * It's not necessary to use name mangling for LVM:
+ * - the character set used for VG-LV names is subset of udev character set
+ * - when we check other devices (e.g. _device_is_usable fn), we use major:minor, not dm names
+ */
+ dm_set_name_mangling_mode(DM_STRING_MANGLING_NONE);
+
/* create context */
/* FIXME: split create_toolcontext */
/* FIXME: make all globals configurable */
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 96e478f..66f691e 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -1527,6 +1527,13 @@ struct cmd_context *init_lvm(void)
if (!udev_init_library_context())
stack;
+ /*
+ * It's not necessary to use name mangling for LVM:
+ * - the character set used for LV names is subset of udev character set
+ * - when we check other devices (e.g. _device_is_usable fn), we use major:minor, not dm names
+ */
+ dm_set_name_mangling_mode(DM_STRING_MANGLING_NONE);
+
if (!(cmd = create_toolcontext(0, NULL, 1, 0))) {
udev_fin_library_context();
return_NULL;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b2da0f0a5b5b99c1…
Commit: b2da0f0a5b5b99c10c2ea531b63a3d9466eb1832
Parent: 37b4dc777590ed0e6771833dce4c0727dfc72465
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed May 21 23:13:59 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed May 21 23:14:42 2014 +0200
tests: raid and dmeventd
---
test/shell/lvconvert-repair-raid-dmeventd.sh | 28 ++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvconvert-repair-raid-dmeventd.sh b/test/shell/lvconvert-repair-raid-dmeventd.sh
new file mode 100644
index 0000000..a825aa2
--- /dev/null
+++ b/test/shell/lvconvert-repair-raid-dmeventd.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+# Copyright (C) 2014 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+. lib/test
+
+which mkfs.ext3 || skip
+
+aux prepare_dmeventd
+aux prepare_vg 5
+
+lvcreate -aey --type raid1 -m 3 --ignoremonitoring -L 1 -n 4way $vg
+lvchange --monitor y $vg/4way
+lvs -a -o all,lv_modules $vg
+lvdisplay --maps $vg
+aux disable_dev "$dev2" "$dev4"
+mkfs.ext3 "$DM_DEV_DIR/$vg/4way"
+sleep 10 # FIXME: need a "poll" utility, akin to "check"
+aux enable_dev "$dev2" "$dev4"
+
+vgremove -ff $vg
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=092659644a6da359…
Commit: 092659644a6da359272b852d6be058a5fc26bff4
Parent: e78092fa3a4cba95ccc8820fb2b2c617e2b0f618
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed May 21 15:51:28 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed May 21 15:51:28 2014 +0200
man: missing space between option name and value name
---
man/lvchange.8.in | 2 +-
man/lvcreate.8.in | 2 +-
man/lvm.8.in | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/man/lvchange.8.in b/man/lvchange.8.in
index 56a35af..09f54e6 100644
--- a/man/lvchange.8.in
+++ b/man/lvchange.8.in
@@ -125,7 +125,7 @@ and copied to the others, so this can take a considerable amount of
time - and during this time you are without a complete redundant copy
of your data.
.TP
-.B \-\-metadataprofile \fIProfileName
+.B \-\-metadataprofile " " \fIProfileName
Uses and attaches ProfileName configuration profile to the logical
volume metadata. Whenever the logical volume is processed next time,
the profile is automatically applied. If the volume group has another
diff --git a/man/lvcreate.8.in b/man/lvcreate.8.in
index 78cef80..ee50587 100644
--- a/man/lvcreate.8.in
+++ b/man/lvcreate.8.in
@@ -284,7 +284,7 @@ will create a persistent log that is itself mirrored.
When the legacy "mirror" segment type is used, the optional argument
\fB\-\-corelog\fP is equivalent to \fB\-\-mirrorlog\fP \fIcore\fP.
.TP
-.BR \-\-metadataprofile \fIProfileName
+.BR \-\-metadataprofile " " \fIProfileName
Uses and attaches the ProfileName configuration profile to the logical
volume metadata. Whenever the logical volume is processed next time,
the profile is automatically applied. If the volume group has another
diff --git a/man/lvm.8.in b/man/lvm.8.in
index c753561..9df3cde 100644
--- a/man/lvm.8.in
+++ b/man/lvm.8.in
@@ -281,12 +281,12 @@ an allocation request but \fInormal\fP doesn't use them,
\fIanywhere\fP will - even if that reduces performance by
placing two stripes on the same Physical Volume.
.TP
-.IR \fB\-\-commandprofile \fIProfileName
+.IR \fB\-\-commandprofile " " \fIProfileName
Selects the command configuration profile to use when processing an LVM command.
See also \fBlvm.conf\fP(5) for more information about \fBcommand profile config\fP and
the way it fits with other LVM configuration methods.
.TP
-.IR \fB\-\-metadataprofile \fIProfileName
+.IR \fB\-\-metadataprofile " " \fIProfileName
Selects the metadata configuration profile to use when processing an LVM command.
When using metadata profile during Volume Group or Logical Volume creation,
the metadata profile name is saved in metadata. When such Volume Group or Logical
@@ -295,7 +295,7 @@ and the use of \-\-metadataprofile option is not necessary. See also
\fBlvm.conf\fP(5) for more information about \fBmetadata profile config\fP and the
way it fits with other LVM configuration methods.
.TP
-.IR \fB\-\-profile \fIProfileName
+.IR \fB\-\-profile " " \fIProfileName
A short form of \fB\-\-metadataprofile\fP for \fBvgcreate\fP, \fBlvcreate\fP,
\fBvgchange\fP and \fBlvchange\fP command and a short form of \fB\-\-commandprofile\fP
for any other command (with the exception of \fBdumpconfig\fP command where the
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b7431f69ed0e8b3b…
Commit: b7431f69ed0e8b3b153b5c5dc1e3fbf990d059b0
Parent: 23f9c45a1bd610c455eb24a1264c07b27cd89fd2
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed May 21 13:25:09 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed May 21 13:25:09 2014 +0200
man: update lvm.conf man page for latest changes
---
man/lvm.conf.5.in | 90 ++++++++++++++++++++++++++++++++--------------------
1 files changed, 55 insertions(+), 35 deletions(-)
diff --git a/man/lvm.conf.5.in b/man/lvm.conf.5.in
index 1bed3d9..e64e2a3 100644
--- a/man/lvm.conf.5.in
+++ b/man/lvm.conf.5.in
@@ -13,62 +13,82 @@ any have changed, all the files are reloaded.
The settings defined in lvm.conf can be overridden by any
of these extended configuration methods:
.TP
-.B tag config
-.br
-See \fBtags\fP configuration setting description below.
+.B direct config override on command line
+The \fB\-\-config ConfigurationString\fP command line option takes the
+ConfigurationString as direct string representation of the configuration
+to override the existing configuration. The ConfigurationString is of
+exactly the same format as used in any LVM configuration file.
.TP
.B profile config
.br
A profile is a set of selected customizable configuration settings
that are aimed to achieve a certain characteristics in various
-environments or uses. Normally, the name of the profile should
-reflect that environment or use.
+environments or uses. It's used to override existing configuration.
+Normally, the name of the profile should reflect that environment or use.
+
+There are two groups of profiles recognised: \fBcommand profiles\fP and
+\fBmetadata profiles\fP.
+
+The \fBcommand profile\fP is used to override selected configuration
+settings at global LVM command level - it is applied at the very beginning
+of LVM command execution and it is used throughout the whole time of LVM
+command execution. The command profile is applied by using the
+\fB\-\-commandprofile ProfileName\fP command line option that is recognised by
+all LVM2 commands.
+
+The \fBmetadata profile\fP is used to override selected configuration
+settings at Volume Group/Logical Volume level - it is applied independently
+for each Volume Group/Logical Volume that is being processed. As such,
+each Volume Group/Logical Volume can store the profile name used
+in its metadata so next time the Volume Group/Logical Volume is
+processed, the profile is applied automatically. If Volume Group and
+any of its Logical Volumes have different profiles defined, the profile
+defined for the Logical Volume is preferred. The metadata profile can be
+attached/detached by using the \fBlvchange\fP and \fBvgchange\fP commands
+and their \fB\-\-metadataprofile ProfileName\fP and
+\fB\-\-detachprofile ProfileName\fP options or the \fB\-\-metadataprofile\fP
+option during creation when using \fBvgcreate\fP or \fBlvcreate\fP command.
+The \fBvgs\fP and \fBlvs\fP reporting commands provide \fB-o vg_profile\fP
+and \fB-o lv_profile\fP output options to show the metadata profile
+currently attached to a Volume Group or a Logical Volume.
+
+The set of options allowed for command profiles is mutually exclusive
+when compared to the set of options allowed for metadata profiles. The
+settings that belong to either of these two sets can't be mixed together
+and LVM tools will reject such profiles.
LVM itself provides a few predefined configuration profiles.
Users are allowed to add more profiles with different values if needed.
-For this purpose, there's the \fBdefault.profile\fP which contains all
-settings that are customizable by profiles. Users are encouraged
-to copy this default profile and edit it as needed. Alternatively,
-the \fBlvm dumpconfig --file <ProfileName.profile> --type profilable <section>\fP
-can be used to generate a configuration with profilable settings for
-given section and save it to new ProfileName.profile (if the section
-is not specified, all profilable settings are reported).
+For this purpose, there's the \fBcommand_profile_template.profile\fP
+(for command profiles) and \fBmetadata_profile_template.profile\fP
+(for metadata profiles) which contain all settings that are customizable
+by profiles of certain type. Users are encouraged to copy these template
+profiles and edit it as needed. Alternatively, the
+\fBlvm dumpconfig --file <ProfileName.profile> --type profilable-command <section>\fP
+or \fBlvm dumpconfig --file <ProfileName.profile> --type profilable-metadata <section>\fP
+can be used to generate a configuration with profilable settings in either
+of the type for given section and save it to new ProfileName.profile
+(if the section is not specified, all profilable settings are reported).
The profiles are stored in #DEFAULT_PROFILE_DIR# directory by default.
-This location can be changed using the \fBconfig/profile_dir\fP setting.
+This location can be changed by using the \fBconfig/profile_dir\fP setting.
Each profile configuration is stored in \fBProfileName.profile\fP file
in the profile directory. When referencing the profile, the \fB.profile\fP
suffix is left out.
-The profile to use can be defined for each LVM command using the \fB\-\-profile ProfileName\fP
-command line option. When using a profile while creating Volume
-Groups or Logical Volumes, the ProfileName is stored in Volume Group
-metadata. When using such volumes later on, the profile is automatically
-loaded and applied. If Volume Group and any of its Logical Volumes have different
-profiles defined, the profile defined for the Logical Volume is used. Profiles
-attached to Volume Groups or Logical Volumes can be changed or detached
-using the \fBvgchange\fP(8) and \fBlvchange\fP(8) commands with \fB\-\-profile ProfileName\fP
-or \fB\-\-detachprofile\fP options. For any other LVM command, the \fB\-\-profile ProfileName\fP
-option causes the profile to be applied only temporarily during the command
-execution for any existing Volume Group or Logical Volume.
-
-The \fBvgs\fP and \fBlvs\fP reporting commands provide \fB-o vg_profile\fP and
-\fB-o lv_profile\fP output options to show the profile currently attached to a
-Volume Group or a Logical Volume.
-
.TP
-.B direct config override on command line
-The \fB\-\-config ConfigurationString\fP command line option takes the
-ConfigurationString as direct string representation of the configuration
-to override the existing configuration. The ConfigurationString is of
-exactly the same format as used in any LVM configuration file.
+.B tag config
+.br
+See \fBtags\fP configuration setting description below.
.LP
When several configuration methods are used at the same time
and when LVM looks for the value of a particular setting, it traverses
this \fBconfig cascade\fP from left to right:
-\fBdirect config override on command line\fP -> \fBprofile config\fP -> \fBtag config\fP -> \fBlvm.conf\fP.
+
+\fBdirect config override on command line\fP -> \fBcommand profile config\fP -> \fBmetadata profile config\fP -> \fBtag config\fP -> \fBlvm.conf\fP
+
No part of this cascade is compulsory. If there's no setting value found at
the end of the cascade, a default value is used for that setting.
Use \fBlvm dumpconfig\fP to check what settings are in use and what
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=97c91b020e234d40…
Commit: 97c91b020e234d40a43ccde9edc2e8f9a4c3bb2b
Parent: 1ddc68ccd72036d00b6d89c1baa9fa544d093095
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed May 21 11:00:55 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed May 21 11:01:19 2014 +0200
man: update dumpconfig man page for latest changes
---
man/lvm-dumpconfig.8.in | 60 +++++++++++++++++++++++++++++++++++++++-------
1 files changed, 51 insertions(+), 9 deletions(-)
diff --git a/man/lvm-dumpconfig.8.in b/man/lvm-dumpconfig.8.in
index e9fe84e..4b21ef1 100644
--- a/man/lvm-dumpconfig.8.in
+++ b/man/lvm-dumpconfig.8.in
@@ -6,11 +6,19 @@ lvm-dumpconfig \- dump LVM configuration
.RB [ \-f | \-\-file ]
.IR filename ]
.RB [ \-\-type
-.RI { current | default | diff | missing | new | profilable }
+.RI { current | default | diff | missing | new | profilable | profilable-command | profilable-metadata }
.RB [ \-\-atversion
.IR version ]
.RB [ \-\-ignoreadvanced ]
.RB [ \-\-ignoreunsupported ]
+.RB [ \-\-config
+.IR ConfigurationString ]
+.RB [ \-\-commandprofile
+.IR ProfileName ]
+.RB [ \-\-profile
+.IR ProfileName ]
+.RB [ \-\-metadataprofile
+.IR ProfileName ]
.RB [ \-\-mergedconfig ]
.RB [ \-\-validate ]
.RB [ \-\-withcomments ]
@@ -55,6 +63,14 @@ or specific version as defined by \fB\-\-atversion\fP option.
.IP profilable 3
Dump all profilable configuration settings with default values assigned.
See \fBlvm.conf\fP(5) for more info about \fBprofile config\fP method.
+.IP profilable-command 3
+Dump all profilable configuration settings with default values assigned
+that can be used in command profile. This is a subset of settings dumped
+by \fB\-\-type \-\-profilable\fP.
+.IP profilable-metadata 3
+Dump all profilable configuration settings with default values assigned
+that can be used in metadata profile. This is a subset of settings dumped
+by \fB\-\-type \-\-profilable\fP.
.RE
.TP
@@ -78,20 +94,46 @@ either used for debugging purposes only or their support is not yet
complete and they are not meant to be used in production.
.TP
+.BI \-\-config " ConfigurationString"
+Use \fBConfigurationString\fP to override existing configuration.
+This configuration is then applied for dumpconfig command itself.
+See also \fBlvm.conf\fP(5) for more info about \fBconfig cascade\fP.
+
+.TP
+.BI \-\-commandprofile " ProfileName"
+Use \fBProfileName\fP to override existing configuration.
+This configuration is then applied for dumpconfig command itself.
+See also \fBlvm.conf\fP(5) for more info about \fBconfig cascade\fP.
+
+.TP
+.BI \-\-profile " ProfileName"
+The same as using \fB\-\-commandprofile\fP but the configuration is not
+applied for dumpconfig command itself.
+
+.TP
+.BI \-\-metadataprofile " ProfileName"
+Use \fBProfileName\fP to override existing configuration.
+The configuration defined in metadata profile has no effect for
+dumpconfig command itself, the dumpconfig dumps the configuration only.
+See also \fBlvm.conf\fP(5) for more info about \fBconfig cascade\fP.
+
+.TP
.B \-\-mergedconfig
When the dumpconfig command is run with the \fB\-\-config\fP option
-and/or \fB\-\-profile\fP option (common options that are recognized
-by all LVM tools, see also \fBlvm\fP(8)), merge the \fB\-\-config\fP
-and/or \fB\-\-profile\fP config with current configuration used
-(see \fB\-\-type current\fP above). Otherwise, only the configuration
-specified within \fB\-\-config\fP or \fB\-\-profile\fP option is dumped
-(see also \fBlvm.conf\fP(5) for more info about \fBconfig cascade\fP).
+and/or \fB\-\-commandprofile\fP, \fB\-\-profile\fP, \fB\-\-metadataprofile\fP
+option, merge all the contents of the \fBconfig cascade\fP before dumping it.
+Without the \fB\-\-mergeconfig\fP option used, only the configuration at
+the front of the cascade is dumped. See also \fBlvm.conf\fP(5) for more
+info about \fBconfig cascade\fP.
.TP
.B \-\-validate
Validate current configuration used and exit with appropriate
-return code. The validation is done even if \fBconfig/checks\fP
-\fBlvm.conf\fP(5) option is disabled.
+return code. The validation is done only for the configuration
+at the front of the \fBconfig cascade\fP. To validate the whole
+merged configuration tree, use also the \fB\-\-mergedconfig\fP option.
+The validation is done even if \fBconfig/checks\fP \fBlvm.conf\fP(5)
+option is disabled.
.TP
.B \-\-withcomments
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=65b3fe9b058862c0…
Commit: 65b3fe9b058862c09994b98c246faaf7e0c0e0aa
Parent: 9fd0be2a8507e1134bf1f5d0e84dd80b765a6b19
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue May 20 12:54:19 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue May 20 21:50:28 2014 +0200
man: cleanup style
---
man/lvconvert.8.in | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/man/lvconvert.8.in b/man/lvconvert.8.in
index 8c3479f..91c5bee 100644
--- a/man/lvconvert.8.in
+++ b/man/lvconvert.8.in
@@ -227,7 +227,7 @@ in the background. You should only use this if udev is not running
or has rules that ignore the devices LVM2 creates.
.TP
.B \-\-splitmirrors \fIImages
-The number of redundant Images of a mirror to be split off and used
+The number of redundant \fIImages\fP of a mirror to be split off and used
to form a new logical volume. A name must be supplied for the
newly-split-off logical volume using the \fB\-\-name\fP argument, unless
the \fB\-\-trackchanges\fP argument is given.
@@ -246,11 +246,11 @@ Please note that this feature is only supported with the new md-based mirror
implementation and not with the original device-mapper mirror implementation.
.TP
.B \-\-splitsnapshot
-Separates SnapshotLogicalVolume from its origin.
+Separates \fISnapshotLogicalVolume\fP from its origin.
The volume that is split off contains the chunks that differ from the origin
along with the metadata describing them. This volume can be wiped and then
destroyed with lvremove.
-The inverse of \-\-snapshot.
+The inverse of \fB\-\-snapshot\fP.
.TP
.B \-s, \-\-snapshot
Recreates a snapshot from constituent logical volumes (or copies of them) after
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9c937e7d54221a78…
Commit: 9c937e7d54221a783d294768efbaad12473a0265
Parent: 9e3e4d69944f072742fd13c5ac74d68e41a3db55
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue May 20 14:45:20 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue May 20 16:27:07 2014 +0200
dumpconfig: add --type profilable-command/profilable-metadata, --metadataprofile/--commandprofile
The dumpconfig now understands --commandprofile/--profile/--metadataprofile
The --commandprofile and --profile functionality is almost the same
with only one difference and that is that the --profile is just used
for dumping the content, it's not applied for the command itself
(while the --commandprofile profile is applied like it is done for
any other LVM command).
We also allow --metadataprofile for dumpconfig - dumpconfig *does not*
touch VG/LV and metadata in any way so it's OK to use it here (just for
dumping the content, checking the profile validity etc.).
The validity of the profile can be checked with:
dumpconfig --commandprofile/--profile/--metadataprofile --validate
...depending on the profile type.
Also, mention --config in the dumpconfig help string so users know
that dumpconfig handles this too (it did even before, but it was not
documented in the help string).
---
WHATS_NEW | 1 +
lib/config/config.c | 11 +++++++++++
lib/config/config.h | 2 ++
tools/commands.h | 10 +++++++---
tools/dumpconfig.c | 26 +++++++++++++++++++++++++-
5 files changed, 46 insertions(+), 4 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index b57a1c3..51249ed 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.107 -
==================================
+ Add dumpconfig --type profilable-{metadata,command} to select profile type.
Exit immediately with error if command profile is found invalid.
Separate --profile cmd line arg into --commandprofile and --metadataprofile.
Strictly separate command profiles and per-VG/LV profiles referenced in mda.
diff --git a/lib/config/config.c b/lib/config/config.c
index 4fbee66..ecb674e 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -1622,6 +1622,7 @@ static struct dm_config_node *_add_def_node(struct dm_config_tree *cft,
static int _should_skip_def_node(struct config_def_tree_spec *spec, int section_id, int id)
{
cfg_def_item_t *def = cfg_def_get_item_p(id);
+ uint16_t flags;
if ((def->parent != section_id) ||
(spec->ignoreadvanced && def->flags & CFG_ADVANCED) ||
@@ -1645,9 +1646,19 @@ static int _should_skip_def_node(struct config_def_tree_spec *spec, int section_
return 1;
break;
case CFG_DEF_TREE_PROFILABLE:
+ case CFG_DEF_TREE_PROFILABLE_CMD:
+ case CFG_DEF_TREE_PROFILABLE_MDA:
if (!(def->flags & CFG_PROFILABLE) ||
(def->since_version > spec->version))
return 1;
+ flags = def->flags & ~CFG_PROFILABLE;
+ if (spec->type == CFG_DEF_TREE_PROFILABLE_CMD) {
+ if (flags & CFG_PROFILABLE_METADATA)
+ return 1;
+ } else if (spec->type == CFG_DEF_TREE_PROFILABLE_MDA) {
+ if (!(flags & CFG_PROFILABLE_METADATA))
+ return 1;
+ }
break;
default:
if (def->since_version > spec->version)
diff --git a/lib/config/config.h b/lib/config/config.h
index 0618045..7b1d5b6 100644
--- a/lib/config/config.h
+++ b/lib/config/config.h
@@ -129,6 +129,8 @@ typedef enum {
CFG_DEF_TREE_DEFAULT, /* tree of all possible config nodes with default values */
CFG_DEF_TREE_NEW, /* tree of all new nodes that appeared in given version */
CFG_DEF_TREE_PROFILABLE, /* tree of all nodes that are customizable by profiles */
+ CFG_DEF_TREE_PROFILABLE_CMD, /* tree of all nodes that are customizable by command profiles (subset of PROFILABLE) */
+ CFG_DEF_TREE_PROFILABLE_MDA, /* tree of all nodes that are customizable by metadata profiles (subset of PROFILABLE) */
CFG_DEF_TREE_DIFF, /* tree of all nodes that differ from defaults */
} cfg_def_tree_t;
diff --git a/tools/commands.h b/tools/commands.h
index 6ed4f8d..50db8eb 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -59,18 +59,22 @@ xx(dumpconfig,
"dumpconfig\n"
"\t[--commandprofile ProfileName]\n"
"\t[-f|--file filename] \n"
- "\t[--type {current|default|diff|missing|new|profilable} \n"
+ "\t[--type {current|default|diff|missing|new|profilable|profilable-command|profilable-metadata} \n"
"\t[--atversion version]] \n"
"\t[--ignoreadvanced] \n"
"\t[--ignoreunsupported] \n"
+ "\t[--config ConfigurationString] \n"
+ "\t[--commandprofile ProfileName] \n"
+ "\t[--profile ProfileName] \n"
+ "\t[--metadataprofile ProfileName] \n"
"\t[--mergedconfig] \n"
"\t[--validate]\n"
"\t[--withcomments] \n"
"\t[--withversions] \n"
"\t[ConfigurationNode...]\n",
atversion_ARG, configtype_ARG, file_ARG, ignoreadvanced_ARG,
- ignoreunsupported_ARG, mergedconfig_ARG, validate_ARG,
- withcomments_ARG, withversions_ARG)
+ ignoreunsupported_ARG, mergedconfig_ARG, metadataprofile_ARG,
+ validate_ARG, withcomments_ARG, withversions_ARG)
xx(formats,
"List available metadata formats",
diff --git a/tools/dumpconfig.c b/tools/dumpconfig.c
index 141a030..09f2119 100644
--- a/tools/dumpconfig.c
+++ b/tools/dumpconfig.c
@@ -92,6 +92,7 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
struct config_def_tree_spec tree_spec = {0};
struct dm_config_tree *cft = NULL;
struct cft_check_handle *cft_check_handle = NULL;
+ struct profile *profile = NULL;
int r = ECMD_PROCESSED;
tree_spec.cmd = cmd;
@@ -132,6 +133,18 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
return EINVALID_CMD_LINE;
/*
+ * The profile specified by --profile cmd arg is like --commandprofile,
+ * but it is used just for dumping the profile content and not for
+ * application.
+ */
+ if (arg_count(cmd, profile_ARG) &&
+ (!(profile = add_profile(cmd, arg_str_value(cmd, profile_ARG, NULL), CONFIG_PROFILE_COMMAND)) ||
+ !override_config_tree_from_profile(cmd, profile))) {
+ log_error("Failed to load profile %s.", arg_str_value(cmd, profile_ARG, NULL));
+ return ECMD_FAILED;
+ }
+
+ /*
* Set the 'cft' to work with based on whether we need the plain
* config tree or merged config tree cascade if --mergedconfig is used.
*/
@@ -188,9 +201,18 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
tree_spec.type = CFG_DEF_TREE_PROFILABLE;
/* profilable type does not require check status */
}
+ else if (!strcmp(type, "profilable-command")) {
+ tree_spec.type = CFG_DEF_TREE_PROFILABLE_CMD;
+ /* profilable-command type does not require check status */
+ }
+ else if (!strcmp(type, "profilable-metadata")) {
+ tree_spec.type = CFG_DEF_TREE_PROFILABLE_MDA;
+ /* profilable-metadata type does not require check status */
+ }
else {
log_error("Incorrect type of configuration specified. "
- "Expected one of: current, default, missing, new, profilable.");
+ "Expected one of: current, default, missing, new, "
+ "profilable, profilable-command, profilable-metadata.");
r = EINVALID_CMD_LINE;
goto out;
}
@@ -218,6 +240,8 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
out:
if (cft && (cft != cmd->cft))
dm_pool_destroy(cft->mem);
+ else if (profile)
+ remove_config_tree_by_source(cmd, CONFIG_PROFILE_COMMAND);
/*
* The cmd->cft (the "current" tree) is destroyed
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=24f32721a9e6a619…
Commit: 24f32721a9e6a61943122f3d06d2329f5f81597c
Parent: 9a324df3b329f1a28462f246219522da62a022ce
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon May 19 14:51:11 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon May 19 15:41:25 2014 +0200
dumpconfig: fix dumpconfig --type diff used in lvm shell as second and later command
The dumpconfig reuses existing config_def_check results in case
the check is done during general lvm command context initialization
(when enabled by config/checks=1) so dumpconfig does not need to run
the same check again during its execution, hence saving some time.
However, we don't check for differences from defaults during general
lvm command initialization as it's useless at that time. It makes
sense only in case when such a check is directly requested (like in
the case of lvm dumpconfig --type diff). We need to take care that
the reused information was already produced with this "diff" checking
before and if not, we need to force the check so the check status also
gathers the new "diff" info now.
Also, do not do diff checking for any other dumpconfig command that
is run after dumpconfig --type diff.
---
WHATS_NEW | 1 +
tools/dumpconfig.c | 8 ++++++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 06d0854..6cbd622 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.107 -
==================================
+ Fix dumpconfig --type diff when run as second and later cmd in lvm shell.
Fix wrong profile reuse from previous run if another cmd is run in lvm shell.
Move cache description from lvm(8) to lvmcache(7) man page.
Display skipped prompt in silent mode.
diff --git a/tools/dumpconfig.c b/tools/dumpconfig.c
index 49a6a68..141a030 100644
--- a/tools/dumpconfig.c
+++ b/tools/dumpconfig.c
@@ -41,10 +41,14 @@ static int _do_def_check(struct config_def_tree_spec *spec,
handle->force_check = 1;
handle->suppress_messages = 1;
- if (spec->type == CFG_DEF_TREE_DIFF)
+ if (spec->type == CFG_DEF_TREE_DIFF) {
+ if (!handle->check_diff)
+ handle->skip_if_checked = 0;
handle->check_diff = 1;
- else
+ } else {
handle->skip_if_checked = 1;
+ handle->check_diff = 0;
+ }
config_def_check(handle);
*cft_check_handle = handle;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9a324df3b329f1a2…
Commit: 9a324df3b329f1a28462f246219522da62a022ce
Parent: c42f72867a653974f07e6e1db52f41691356e5b7
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon May 19 13:59:23 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon May 19 15:39:55 2014 +0200
config: fix incorrect profile initialization on cmd context refresh
When cmd refresh is called, we need to move any already loaded profiles
to profiles_to_load list which will cause their reload on subsequent
use. In addition to that, we need to take into account any change
in config/profile configuration setting on cmd context refresh
since this setting could be overriden with --config.
Also, when running commands in the shell, we need to remove the
global profile used from the configuration cascade so the profile
is not incorrectly reused next time when the --profile option is
not specified anymore for the next command in the shell.
This bug only affected profile specified by --profile cmd line
arg, not profiles referenced from LVM metadata.
---
WHATS_NEW | 1 +
lib/commands/toolcontext.c | 50 ++++++++++++++++++++++++++++++++++---------
lib/config/config.h | 2 +-
tools/lvmcmdline.c | 18 +++++++++------
4 files changed, 52 insertions(+), 19 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 72834a8..06d0854 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.107 -
==================================
+ Fix wrong profile reuse from previous run if another cmd is run in lvm shell.
Move cache description from lvm(8) to lvmcache(7) man page.
Display skipped prompt in silent mode.
Make reporting commands show help about possible sort keys on '-O help'.
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index 03b06d2..904ae83 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -630,8 +630,9 @@ static int _init_profiles(struct cmd_context *cmd)
{
const char *dir;
struct profile_params *pp;
+ int initialized = cmd->profile_params != NULL;
- if (!(pp = dm_pool_zalloc(cmd->libmem, sizeof(*pp)))) {
+ if (!initialized && !(pp = dm_pool_zalloc(cmd->libmem, sizeof(*pp)))) {
log_error("profile_params alloc failed");
return 0;
}
@@ -639,11 +640,15 @@ static int _init_profiles(struct cmd_context *cmd)
if (!(dir = find_config_tree_str(cmd, config_profile_dir_CFG, NULL)))
return_0;
- pp->dir = dm_pool_strdup(cmd->libmem, dir);
- dm_list_init(&pp->profiles_to_load);
- dm_list_init(&pp->profiles);
+ if (initialized) {
+ dm_strncpy(cmd->profile_params->dir, dir, sizeof(pp->dir));
+ } else {
+ dm_strncpy(pp->dir, dir, sizeof(pp->dir));
+ dm_list_init(&pp->profiles_to_load);
+ dm_list_init(&pp->profiles);
+ cmd->profile_params = pp;
+ }
- cmd->profile_params = pp;
return 1;
}
@@ -693,7 +698,7 @@ static void _destroy_config(struct cmd_context *cmd)
{
struct config_tree_list *cfl;
struct dm_config_tree *cft;
- struct profile *profile;
+ struct profile *profile, *tmp_profile;
/*
* Configuration cascade:
@@ -713,12 +718,17 @@ static void _destroy_config(struct cmd_context *cmd)
/* CONFIG_PROFILE */
if (cmd->profile_params) {
remove_config_tree_by_source(cmd, CONFIG_PROFILE);
- dm_list_iterate_items(profile, &cmd->profile_params->profiles_to_load)
- config_destroy(profile->cft);
- dm_list_iterate_items(profile, &cmd->profile_params->profiles)
+ /*
+ * Destroy config trees for any loaded profiles and
+ * move these profiles to profile_to_load list.
+ * Whenever these profiles are referenced later,
+ * they will get loaded again automatically.
+ */
+ dm_list_iterate_items_safe(profile, tmp_profile, &cmd->profile_params->profiles) {
config_destroy(profile->cft);
- dm_list_init(&cmd->profile_params->profiles_to_load);
- dm_list_init(&cmd->profile_params->profiles);
+ profile->cft = NULL;
+ dm_list_move(&cmd->profile_params->profiles_to_load, &profile->list);
+ }
}
/* CONFIG_STRING */
@@ -1595,6 +1605,8 @@ int refresh_filters(struct cmd_context *cmd)
int refresh_toolcontext(struct cmd_context *cmd)
{
struct dm_config_tree *cft_cmdline, *cft_tmp;
+ const char *profile_name;
+ struct profile *profile;
log_verbose("Reloading config files");
@@ -1617,7 +1629,13 @@ int refresh_toolcontext(struct cmd_context *cmd)
_destroy_dev_types(cmd);
_destroy_tags(cmd);
+ /* save config string passed on the command line */
cft_cmdline = remove_config_tree_by_source(cmd, CONFIG_STRING);
+
+ /* save the global profile name used */
+ profile_name = cmd->profile_params->global_profile ?
+ cmd->profile_params->global_profile->name : NULL;
+
_destroy_config(cmd);
cmd->config_initialized = 0;
@@ -1634,6 +1652,13 @@ int refresh_toolcontext(struct cmd_context *cmd)
if (cft_cmdline)
cmd->cft = dm_config_insert_cascaded_tree(cft_cmdline, cft_tmp);
+ /* Reload the global profile. */
+ if (profile_name) {
+ if (!(profile = add_profile(cmd, profile_name)) ||
+ !override_config_tree_from_profile(cmd, profile))
+ return_0;
+ }
+
/* Uses cmd->cft i.e. cft_cmdline + lvm.conf */
_init_logging(cmd);
@@ -1657,6 +1682,9 @@ int refresh_toolcontext(struct cmd_context *cmd)
if (!_process_config(cmd))
return_0;
+ if (!_init_profiles(cmd))
+ return_0;
+
if (!(cmd->dev_types = create_dev_types(cmd->proc_dir,
find_config_tree_node(cmd, devices_types_CFG, NULL))))
return_0;
diff --git a/lib/config/config.h b/lib/config/config.h
index 4967b27..df5841c 100644
--- a/lib/config/config.h
+++ b/lib/config/config.h
@@ -41,7 +41,7 @@ struct profile {
};
struct profile_params {
- const char *dir; /* subdir in LVM_SYSTEM_DIR where LVM looks for profiles */
+ char dir[PATH_MAX]; /* subdir in LVM_SYSTEM_DIR where LVM looks for profiles */
struct profile *global_profile; /* profile that overrides any other VG/LV-based profile ('--profile' cmd line arg) */
struct dm_list profiles_to_load;/* list of profiles which are only added, but still need to be loaded for any use */
struct dm_list profiles; /* list of profiles which are loaded already and which are ready for use */
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 7e4d9a6..69e5781 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -1081,11 +1081,11 @@ static const char *_copy_command_line(struct cmd_context *cmd, int argc, char **
int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
{
+ struct dm_config_tree *config_string_cft, *config_profile_cft;
+ struct profile *profile;
int ret = 0;
int locking_type;
int monitoring;
- struct dm_config_tree *old_cft;
- struct profile *profile;
init_error_message_produced(0);
@@ -1124,9 +1124,8 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
if (arg_count(cmd, config_ARG) || !cmd->config_initialized || config_files_changed(cmd)) {
/* Reinitialise various settings inc. logging, filters */
if (!refresh_toolcontext(cmd)) {
- old_cft = remove_config_tree_by_source(cmd, CONFIG_STRING);
- if (old_cft)
- dm_config_destroy(old_cft);
+ if ((config_string_cft = remove_config_tree_by_source(cmd, CONFIG_STRING)))
+ dm_config_destroy(config_string_cft);
log_error("Updated config file invalid. Aborting.");
return ECMD_FAILED;
}
@@ -1204,8 +1203,13 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
lvmcache_destroy(cmd, 1, 0);
}
- if ((old_cft = remove_config_tree_by_source(cmd, CONFIG_STRING))) {
- dm_config_destroy(old_cft);
+ if ((config_string_cft = remove_config_tree_by_source(cmd, CONFIG_STRING)))
+ dm_config_destroy(config_string_cft);
+
+ config_profile_cft = remove_config_tree_by_source(cmd, CONFIG_PROFILE);
+ cmd->profile_params->global_profile = NULL;
+
+ if (config_string_cft || config_profile_cft) {
/* Move this? */
if (!refresh_toolcontext(cmd))
stack;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=477351fc4d2f2d0a…
Commit: 477351fc4d2f2d0a55089fb6b6bc1f26e2605f7b
Parent: 91284bd9b913f74a0071082d542c3c09d11524f2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun May 18 20:09:47 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun May 18 20:09:47 2014 +0200
man: lvmcache
separate man page for lvm cache
---
man/lvmcache.7.in | 201 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 201 insertions(+), 0 deletions(-)
diff --git a/man/lvmcache.7.in b/man/lvmcache.7.in
new file mode 100644
index 0000000..5a09257
--- /dev/null
+++ b/man/lvmcache.7.in
@@ -0,0 +1,201 @@
+.TH "LVMCACHE" "7" "LVM TOOLS #VERSION#" "Red Hat, Inc" "\""
+.SH NAME
+lvmcache - LVM caching
+
+.SH DESCRIPTION
+
+The \fIcache\fP logical volume type uses a small and fast LV to improve
+the performance of a large and slow LV. It does this by storing the
+frequently used blocks on the faster LV.
+LVM refers to the small fast LV as a \fBcache pool LV\fP. The large
+slow LV is called the \fBorigin LV\fP. Due to requirements from dm-cache
+(the kernel driver), LVM further splits the cache pool LV into two
+devices - the \fBcache data LV\fP and \fBcache metadata LV\fP. The cache
+data LV is where copies of data blocks are kept from the
+origin LV to increase speed. The cache metadata LV holds the
+accounting information that specifies where data blocks are stored (e.g.
+on the origin LV or on the cache data LV). Users should be familiar with
+these LVs if they wish to create the best and most robust cached
+logical volumes.
+
+.SS Cache Terms
+.nf
+origin LV OriginLV large slow LV
+cache data LV CacheDataLV small fast LV for cache pool data
+cache metadata LV CacheMetaLV small fast LV for cache pool metadata
+cache pool LV CachePoolLV CacheDataLV + CacheMetaLV
+cache LV CacheLV OriginLV + CachePoolLV
+.fi
+
+.SS Cache Steps
+The steps to create a logical volume of \fIcache\fP type are as follows:
+.TP
+0.
+Create an LV or identify an existing LV to be the origin LV.
+.TP
+1.
+Create the cache data LV. The size of this LV is the size of the cache
+and will be reported as the size of the cache pool LV.
+.TP
+2.
+Create the cache metadata LV.
+The size of this LV should be 1000 times smaller than the cache data LV
+with a minimum size of 8MiB.
+.TP
+3.
+Create the cache pool LV by combining the cache data LV (from step 1)
+and cache metadata LV (from step 2). When performing this step,
+behavioral characteristics of the cache pool LV can be set.
+The name of the cache pool LV takes the name of the cache data LV and
+the cache data LV and cache metadata LV are renamed
+to CachePoolLV_cdata and CachePoolLV_cmeta.
+.TP
+4.
+Create a cache LV by linking the cache pool LV to the origin LV.
+The user accessible cache LV takes the name of the origin LV,
+while the origin LV becomes a hidden LV with the name
+OriginLV_corig. Users can perform this step while the origin LV
+is in use.
+
+.P
+The steps above represent the best way to create a cache LV.
+They provide the most options and have the ability to create the
+most robust logical volumes. The examples below illustrate how these
+steps might be used in practice.
+
+.SS Cache Commands
+.nf
+0. create OriginLV
+lvcreate -L LargeSize -n OriginLV VG SlowPVs
+
+1. create CacheDataLV
+lvcreate -L CacheSize -n CacheDataLV VG FastPVs
+
+2. create CacheMetaLV
+lvcreate -L MetaSize -n CacheMetaLV VG FastPVs
+
+3. create CachePoolLV
+lvconvert --type cache-pool --poolmetadata VG/CacheMetaLV VG/CacheDataLV
+CachePoolLV takes the name of CacheDataLV.
+CacheDataLV is renamed CachePoolLV_cdata and becomes hidden.
+CacheMetaLV is renamed CachePoolLV_cmeta and becomes hidden.
+
+4. create CacheLV
+lvconvert --type cache --cachepool VG/CachePoolLV VG/OriginLV
+CacheLV takes the name of OriginLV.
+OriginLV is renamed OriginLV_corig and becomes hidden.
+.fi
+
+.SS Cache Examples
+
+.B Example 1:
+Creating a simple cache LV.
+.br
+
+.nf
+0. Create the origin LV
+# lvcreate -L 10G -n lvx vg /dev/slow_dev
+
+1. Create a cache data LV
+# lvcreate -L 1G -n lvx_cache vg /dev/fast_dev
+
+2. Create a cache metadata LV (~1/1000th size of CacheDataLV or 8MiB)
+# lvcreate -L 8M -n lvx_cache_meta vg /dev/fast_dev
+
+3. Create a cache pool LV, combining cache data LV and cache metadata LV
+# lvconvert --type cache-pool --poolmetadata vg/lvx_cache_meta \\
+ vg/lvx_cache
+
+4. Create a cached LV by combining the cache pool LV and origin LV
+# lvconvert --type cache --cachepool vg/lvx_cache vg/lvx
+.fi
+
+.B Example 2:
+Creating a cache LV with a fault tolerant cache pool LV.
+
+Users who are concerned about the possibility of failures in their fast devices
+that could lead to data loss might consider making their cache pool sub-LVs
+redundant. Example 2 illustrates how to do that. Note that only steps
+1 & 2 change.
+
+.nf
+0. Create an origin LV we wish to cache
+# lvcreate -L 10G -n lvx vg /dev/slow_devs
+
+1. Create a 2-way RAID1 cache data LV
+# lvcreate --type raid1 -m 1 -L 1G -n lvx_cache vg \\
+ /dev/fast1 /dev/fast2
+
+2. Create a 2-way RAID1 cache metadata LV
+# lvcreate --type raid1 -m 1 -L 8M -n lvx_cache_meta vg \\
+ /dev/fast1 /dev/fast2
+
+3. Create a cache pool LV combining cache data LV and cache metadata LV
+# lvconvert --type cache-pool --poolmetadata vg/lvx_cache_meta \\
+ vg/lvx_cache
+
+4. Create a cached LV by combining the cache pool LV and origin LV
+# lvconvert --type cache --cachepool vg/lvx_cache vg/lvx
+.fi
+
+.B Example 3:
+Creating a simple cache LV with \fIwritethough\fP caching.
+
+Some users wish to ensure that any data written will be stored both in the
+cache pool LV and on the origin LV. The loss of a device associated with
+the cache pool LV in this case would not mean the loss of any data. When
+combining the cache data LV and the cache metadata LV to form the cache pool
+LV, properties of the cache can be specified - in this case,
+\fIwritethrough\fP vs. \fIwriteback\fP. Note that only step 3 is affected
+in this case.
+
+.nf
+0. Create an origin LV we wish to cache (yours may already exist)
+# lvcreate -L 10G -n lvx vg /dev/slow
+
+1. Create a cache data LV
+# lvcreate -L 1G -n lvx_cache vg /dev/fast
+
+2. Create a cache metadata LV
+# lvcreate -L 8M -n lvx_cache_meta vg /dev/fast
+
+3. Create a cache pool LV specifying cache mode "writethrough"
+# lvconvert --type cache-pool --poolmetadata vg/lvx_cache_meta \\
+ --cachemode writethrough vg/lvx_cache
+
+4. Create a cache LV by combining the cache pool LV and origin LV
+# lvconvert --type cache --cachepool vg/lvx_cache vg/lvx
+.fi
+
+.SS Removing Cache Logical Volumes
+If you wish to remove all logical volumes associated with a cache
+LV, you must remove both top-level, user-visible devices.
+The cache metadata LV and cache data LV cannot be removed
+directly. If only the cache pool LV is specfied for removal, any cached
+blocks not yet on the origin LV will be flush, the cache pool LV will be
+removed, and the now un-cached origin LV will remain. If the user
+specifies a cache LV for removal, then the origin LV is
+removed and only the cache pool LV will remain. The cache pool LV can then
+be used to create another cache LV with a different origin LV if desired.
+
+When users intend to remove all logical volumes associated with a
+cache LV, it is generally better to start with the origin LV and then
+remove the cache pool LV. If the operations are performed in the
+reverse order, the user will have to wait for the contents of the
+cache pool LV to be flushed before the origin LV is removed. This
+could take some time.
+
+.SH SEE ALSO
+.BR lvm.conf (5),
+.BR lvchange (8),
+.BR lvcreate (8),
+.BR lvdisplay (8),
+.BR lvextend (8),
+.BR lvremove (8),
+.BR lvrename (8),
+.BR lvresize (8),
+.BR lvs (8),
+.BR vgchange (8),
+.BR vgmerge (8),
+.BR vgreduce (8),
+.BR vgsplit (8)
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b73a78675576c562…
Commit: b73a78675576c562b8bf510d16dab8a35bf4cb02
Parent: 11bedf1baf6dbc48c7abf9a14f8584d996d00a59
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu May 15 12:06:18 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu May 15 12:13:24 2014 +0200
man: lvmcache
Migrate cache description into man(7) entry
(like lvmthin).
---
WHATS_NEW | 1 +
man/Makefile.in | 11 ++-
man/lvm.8.in | 189 +---------------------------------------------------
spec/packages.inc | 1 +
4 files changed, 13 insertions(+), 189 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 5900bc6..72834a8 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.107 -
==================================
+ Move cache description from lvm(8) to lvmcache(7) man page.
Display skipped prompt in silent mode.
Make reporting commands show help about possible sort keys on '-O help'.
Add metadata_percent to lvs_cols.
diff --git a/man/Makefile.in b/man/Makefile.in
index c6a27d0..dd59555 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -41,6 +41,7 @@ LVMETAD =
endif
MAN5=lvm.conf.5
+MAN7=
MAN8=lvm-dumpconfig.8 \
lvchange.8 lvconvert.8 lvcreate.8 lvdisplay.8 lvextend.8 lvm.8 \
lvmchange.8 lvmconf.8 lvmdiskscan.8 lvmdump.8 lvmsadc.8 lvmsar.8 \
@@ -61,10 +62,12 @@ ifeq ("@BUILD_CMIRRORD@", "yes")
MAN8CLUSTER+=cmirrord.8
endif
+ifneq ("@CACHE@", "none")
+ MAN7+=lvmcache.7
+endif
+
ifneq ("@THIN@", "none")
- MAN7=lvmthin.7
-else
- MAN7=
+ MAN7+=lvmthin.7
endif
MAN8DM=dmsetup.8 $(DMEVENTDMAN)
@@ -75,7 +78,7 @@ MAN8DIR=$(mandir)/man8
MAN8SYSTEMD_GENERATORS=lvm2-activation-generator.8
CLEAN_TARGETS=$(MAN5) $(MAN7) $(MAN8) $(MAN8CLUSTER) $(FSADMMAN) $(BLKDEACTIVATEMAN) $(DMEVENTDMAN) $(MAN8DM)
-DISTCLEAN_TARGETS=fsadm.8 clvmd.8 cmirrord.8 dmeventd.8 lvmthin.7 blkdeactivate.8
+DISTCLEAN_TARGETS=fsadm.8 clvmd.8 cmirrord.8 dmeventd.8 lvmcache.7 lvmthin.7 blkdeactivate.8
include $(top_builddir)/make.tmpl
diff --git a/man/lvm.8.in b/man/lvm.8.in
index e1063c6..41223b0 100644
--- a/man/lvm.8.in
+++ b/man/lvm.8.in
@@ -406,191 +406,8 @@ a command.
Some logical volume types are simple to create and can be done with a
single \fBlvcreate\fP(8) command. The linear and striped logical
volume types are an example of this. Other logical volume types may
-require more than one command to create. The cache and thin provisioning
-types are examples of this.
-
-.br
-.SS Cache
-The \fIcache\fP logical volume type uses a small and fast LV to improve
-the performance of a large and slow LV. It does this by storing the
-frequently used blocks on the faster LV.
-LVM refers to the small fast LV as a \fBcache pool LV\fP. The large
-slow LV is called the \fBorigin LV\fP. Due to requirements from dm-cache
-(the kernel driver), LVM further splits the cache pool LV into two
-devices - the \fBcache data LV\fP and \fBcache metadata LV\fP. The cache
-data LV is where copies of data blocks are kept from the
-origin LV to increase speed. The cache metadata LV holds the
-accounting information that specifies where data blocks are stored (e.g.
-on the origin LV or on the cache data LV). Users should be familiar with
-these LVs if they wish to create the best and most robust cached
-logical volumes.
-
-.SS Cache Terms
-.nf
-origin LV OriginLV large slow LV
-cache data LV CacheDataLV small fast LV for cache pool data
-cache metadata LV CacheMetaLV small fast LV for cache pool metadata
-cache pool LV CachePoolLV CacheDataLV + CacheMetaLV
-cache LV CacheLV OriginLV + CachePoolLV
-.fi
-
-.SS Cache Steps
-The steps to create a logical volume of \fIcache\fP type are as follows:
-.TP
-0.
-Create an LV or identify an existing LV to be the origin LV.
-.TP
-1.
-Create the cache data LV. The size of this LV is the size of the cache
-and will be reported as the size of the cache pool LV.
-.TP
-2.
-Create the cache metadata LV.
-The size of this LV should be 1000 times smaller than the cache data LV
-with a minimum size of 8MiB.
-.TP
-3.
-Create the cache pool LV by combining the cache data LV (from step 1)
-and cache metadata LV (from step 2). When performing this step,
-behavioral characteristics of the cache pool LV can be set.
-The name of the cache pool LV takes the name of the cache data LV and
-the cache data LV and cache metadata LV are renamed
-to CachePoolLV_cdata and CachePoolLV_cmeta.
-.TP
-4.
-Create a cache LV by linking the cache pool LV to the origin LV.
-The user accessible cache LV takes the name of the origin LV,
-while the origin LV becomes a hidden LV with the name
-OriginLV_corig. Users can perform this step while the origin LV
-is in use.
-
-.P
-The steps above represent the best way to create a cache LV.
-They provide the most options and have the ability to create the
-most robust logical volumes. The examples below illustrate how these
-steps might be used in practice.
-
-.SS Cache Commands
-.nf
-0. create OriginLV
-lvcreate -L LargeSize -n OriginLV VG SlowPVs
-
-1. create CacheDataLV
-lvcreate -L CacheSize -n CacheDataLV VG FastPVs
-
-2. create CacheMetaLV
-lvcreate -L MetaSize -n CacheMetaLV VG FastPVs
-
-3. create CachePoolLV
-lvconvert --type cache-pool --poolmetadata VG/CacheMetaLV VG/CacheDataLV
-CachePoolLV takes the name of CacheDataLV.
-CacheDataLV is renamed CachePoolLV_cdata and becomes hidden.
-CacheMetaLV is renamed CachePoolLV_cmeta and becomes hidden.
-
-4. create CacheLV
-lvconvert --type cache --cachepool VG/CachePoolLV VG/OriginLV
-CacheLV takes the name of OriginLV.
-OriginLV is renamed OriginLV_corig and becomes hidden.
-.fi
-
-.SS Cache Examples
-
-.B Example 1:
-Creating a simple cache LV.
-.br
-
-.nf
-0. Create the origin LV
-# lvcreate -L 10G -n lvx vg /dev/slow_dev
-
-1. Create a cache data LV
-# lvcreate -L 1G -n lvx_cache vg /dev/fast_dev
-
-2. Create a cache metadata LV (~1/1000th size of CacheDataLV or 8MiB)
-# lvcreate -L 8M -n lvx_cache_meta vg /dev/fast_dev
-
-3. Create a cache pool LV, combining cache data LV and cache metadata LV
-# lvconvert --type cache-pool --poolmetadata vg/lvx_cache_meta \\
- vg/lvx_cache
-
-4. Create a cached LV by combining the cache pool LV and origin LV
-# lvconvert --type cache --cachepool vg/lvx_cache vg/lvx
-.fi
-
-.B Example 2:
-Creating a cache LV with a fault tolerant cache pool LV.
-
-Users who are concerned about the possibility of failures in their fast devices
-that could lead to data loss might consider making their cache pool sub-LVs
-redundant. Example 2 illustrates how to do that. Note that only steps
-1 & 2 change.
-
-.nf
-0. Create an origin LV we wish to cache
-# lvcreate -L 10G -n lvx vg /dev/slow_devs
-
-1. Create a 2-way RAID1 cache data LV
-# lvcreate --type raid1 -m 1 -L 1G -n lvx_cache vg \\
- /dev/fast1 /dev/fast2
-
-2. Create a 2-way RAID1 cache metadata LV
-# lvcreate --type raid1 -m 1 -L 8M -n lvx_cache_meta vg \\
- /dev/fast1 /dev/fast2
-
-3. Create a cache pool LV combining cache data LV and cache metadata LV
-# lvconvert --type cache-pool --poolmetadata vg/lvx_cache_meta \\
- vg/lvx_cache
-
-4. Create a cached LV by combining the cache pool LV and origin LV
-# lvconvert --type cache --cachepool vg/lvx_cache vg/lvx
-.fi
-
-.B Example 3:
-Creating a simple cache LV with \fIwritethough\fP caching.
-
-Some users wish to ensure that any data written will be stored both in the
-cache pool LV and on the origin LV. The loss of a device associated with
-the cache pool LV in this case would not mean the loss of any data. When
-combining the cache data LV and the cache metadata LV to form the cache pool
-LV, properties of the cache can be specified - in this case,
-\fIwritethrough\fP vs. \fIwriteback\fP. Note that only step 3 is affected
-in this case.
-
-.nf
-0. Create an origin LV we wish to cache (yours may already exist)
-# lvcreate -L 10G -n lvx vg /dev/slow
-
-1. Create a cache data LV
-# lvcreate -L 1G -n lvx_cache vg /dev/fast
-
-2. Create a cache metadata LV
-# lvcreate -L 8M -n lvx_cache_meta vg /dev/fast
-
-3. Create a cache pool LV specifying cache mode "writethrough"
-# lvconvert --type cache-pool --poolmetadata vg/lvx_cache_meta \\
- --cachemode writethrough vg/lvx_cache
-
-4. Create a cache LV by combining the cache pool LV and origin LV
-# lvconvert --type cache --cachepool vg/lvx_cache vg/lvx
-.fi
-
-.SS Removing Cache Logical Volumes
-If you wish to remove all logical volumes associated with a cache
-LV, you must remove both top-level, user-visible devices.
-The cache metadata LV and cache data LV cannot be removed
-directly. If only the cache pool LV is specfied for removal, any cached
-blocks not yet on the origin LV will be flush, the cache pool LV will be
-removed, and the now un-cached origin LV will remain. If the user
-specifies a cache LV for removal, then the origin LV is
-removed and only the cache pool LV will remain. The cache pool LV can then
-be used to create another cache LV with a different origin LV if desired.
-
-When users intend to remove all logical volumes associated with a
-cache LV, it is generally better to start with the origin LV and then
-remove the cache pool LV. If the operations are performed in the
-reverse order, the user will have to wait for the contents of the
-cache pool LV to be flushed before the origin LV is removed. This
-could take some time.
+require more than one command to create. The cache (\fBlvmcache\fP(7))
+and thin provisioning (\fBlvmthin\fP(7)) types are examples of this.
.SH DIAGNOSTICS
All tools return a status code of zero on success or non-zero on failure.
@@ -600,6 +417,8 @@ All tools return a status code of zero on success or non-zero on failure.
.I $HOME/.lvm_history
.SH SEE ALSO
.BR lvm.conf (5),
+.BR lvmcache (7),
+.BR lvmthin (7),
.BR lvm\ dumpconfig (8),
.BR clvmd (8),
.BR lvchange (8),
diff --git a/spec/packages.inc b/spec/packages.inc
index 16b90e0..5999ab7 100644
--- a/spec/packages.inc
+++ b/spec/packages.inc
@@ -83,6 +83,7 @@ fi
%{_sbindir}/lvmetad
%endif
%{_mandir}/man5/lvm.conf.5.gz
+%{_mandir}/man7/lvmcache.7.gz
%{_mandir}/man7/lvmthin.7.gz
%{_mandir}/man8/fsadm.8.gz
%{_mandir}/man8/lvchange.8.gz
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=309201a53bcbbd49…
Commit: 309201a53bcbbd4967f380214e688c520b957fdf
Parent: 7c86131233011c9fb81190bcb40d5d4ac54a533d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu May 15 10:25:15 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu May 15 12:08:35 2014 +0200
man:misc updates
---
man/lvchange.8.in | 6 +++++-
man/lvconvert.8.in | 35 ++++++++++++++++++++++-------------
2 files changed, 27 insertions(+), 14 deletions(-)
diff --git a/man/lvchange.8.in b/man/lvchange.8.in
index 5de75e0..b138c3d 100644
--- a/man/lvchange.8.in
+++ b/man/lvchange.8.in
@@ -181,7 +181,7 @@ the number of I/Os to the drive to a minimum. The default behavior is to
set the write-mostly attribute for the specified physical volume in the
logical volume. It is possible to also remove the write-mostly flag by
appending a ":n" to the physical volume or to toggle the value by specifying
-":t". The \fI--writemostly\fP argument can be specified more than one time
+":t". The \fB--writemostly\fP argument can be specified more than one time
in a single command; making it possible to toggle the write-mostly attributes
for all the physical volumes in a logical volume at once.
.TP
@@ -237,6 +237,10 @@ manually without a clustered lock manager.
Set zeroing mode for thin pool. Note: already provisioned blocks from pool
in non-zero mode are not cleared in unwritten parts when setting zero to
\fIy\fP.
+.SH ENVIRONMENT VARIABLES
+.TP
+.B LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES
+Suppress locking failure messages.
.SH Examples
Changes the permission on volume lvol1 in volume group vg00 to be read-only:
.sp
diff --git a/man/lvconvert.8.in b/man/lvconvert.8.in
index fe6525b..8c3479f 100644
--- a/man/lvconvert.8.in
+++ b/man/lvconvert.8.in
@@ -162,15 +162,17 @@ Exactly one of
.BR \-\-replace ,
.BR \-\-splitsnapshot ,
.BR \-\-snapshot ,
-.BR \-\-splitmirrors
-or
+.BR \-\-splitmirrors ,
+.BR \-\-thin ,
.BR \-\-thinpool
+or
+.BR \-\-type
arguments is required.
.TP
.BR \-b ", " \-\-background
Run the daemon in the background.
.TP
-.BR \-\-cachepool " " \fCachePoolLV
+.BR \-\-cachepool " " \fICachePoolLV
This argument is necessary when converting a logical volume to a cache LV.
For more information on cache pool LVs and cache LVs, see \fBlvm\fP(8).
.TP
@@ -204,9 +206,15 @@ A mirror is divided into regions of this size (in MB), and the mirror log
uses this granularity to track which regions are in sync.
.TP
.B \-\-type \fISegmentType
-Used to convert a logical volume to another segment type, like cache-pool,
-cache, raid1, or thin-pool. When converting a logical volume to a cache LV,
-the \-\-cachepool argument is required.
+Used to convert a logical volume to another segment type, like
+.IR cache-pool ,
+.IR cache ,
+.IR raid1 ,
+or
+.IR thin-pool .
+When converting a logical volume to a cache LV, the
+.B \-\-cachepool
+argument is required.
.TP
.BR \-i ", " \-\-interval " " \fISeconds
Report progress as a percentage at regular intervals.
@@ -246,8 +254,9 @@ The inverse of \-\-snapshot.
.TP
.B \-s, \-\-snapshot
Recreates a snapshot from constituent logical volumes (or copies of them) after
-having been separated using \-\-splitsnapshot. For this to work correctly, no
-changes may be made to the contents of either volume after the split.
+having been separated using \fB\-\-splitsnapshot\fP.
+For this to work correctly, no changes may be made to the contents
+of either volume after the split.
.TP
.BR \-c ", " \-\-chunksize " " \fIChunkSize [ \fIbBsSkKmMgG ]
Gives the size of chunk for snapshot and thin pool logical volumes.
@@ -328,9 +337,9 @@ Default unit is megabytes.
.TP
.IR \fB\-r ", " \fB\-\-readahead " {" ReadAheadSectors | auto | none }
Sets read ahead sector count of thin pool metadata logical volume.
-The default value is "auto" which allows the kernel to choose
+The default value is "\fIauto\fP" which allows the kernel to choose
a suitable value automatically.
-"None" is equivalent to specifying zero.
+"\fINone\fP" is equivalent to specifying zero.
.TP
.B \-\-repair
Repair a mirror after suffering a disk failure or try to fix thin pool metadata.
@@ -380,9 +389,9 @@ The volume cannot be further modified as long as it is used as an
external origin volume for unprovisioned areas of any thin logical volume.
.TP
.IR \fB\-\-thinpool " " ThinPoolLogicalVolume { Name | Path }
-Changes logical volume into a thin pool volume. The volume
-will store the pool's data.
-Thin pool metadata logical volume can be specified with the option
+Switches logical volume into a thin pool's data volume.
+Content of converted volume is lost.
+Thin pool's metadata logical volume can be specified with the option
\fB\-\-poolmetadata\fP or allocated with \fB\-\-poolmetadatasize\fP.
.SH Examples
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=044b7968005a23e5…
Commit: 044b7968005a23e52a78c26eb56a7f74a973312f
Parent: 3b989e317fecf115ce9a2b89f777e4feec2461ec
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed May 14 09:44:09 2014 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed May 14 15:15:35 2014 -0500
man: more lvmthin discard references
and some fixes from Tom.
---
man/lvmthin.7.in | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/man/lvmthin.7.in b/man/lvmthin.7.in
index 55b1562..5a4ee87 100644
--- a/man/lvmthin.7.in
+++ b/man/lvmthin.7.in
@@ -23,10 +23,10 @@ that will hold blocks for thin LVs, and a metadata LV that will hold
metadata. The metadata tracks which data blocks belong to each thin LV.
Snapshots of thin LVs are efficient because the data blocks common to a
-thin LV and its snapshot are shared. Snapshots may be taken of thin LVs
-or of other thin snapshots. Blocks common to recursive snapshots are also
-shared in the thin pool. There is no limit to or degradation from
-sequences of snapshots.
+thin LV and any of its snapshots are shared. Snapshots may be taken of
+thin LVs or of other thin snapshots. Blocks common to recursive snapshots
+are also shared in the thin pool. There is no limit to or degradation
+from sequences of snapshots.
As thin LVs or snapshot LVs are written to, they consume data blocks in
the thin pool. As free data blocks in the pool decrease, more free blocks
@@ -620,6 +620,9 @@ pool0 vg twi-a-tz-- 10.00g 47.01 21.03
thin1 vg Vwi-aotz-- 100.00g pool0 2.70
.fi
+The "Discard" section covers an option for automatically freeing data
+space in a thin pool.
+
.SS Automatically extend thin pool LV
@@ -691,7 +694,7 @@ extended. (Disabling dmeventd is not recommended.)
writes to thin LVs in the pool. (This can be addressed by tuning the
thin_pool_autoextend_threshold and thin_pool_autoextend_percent.)
-4. The VG does have enough free blocks to extend the thin pool.
+4. The VG does not have enough free blocks to extend the thin pool.
The response to data space exhaustion is to extend the thin pool. This is
described in the section "Manually manage free data space of thin pool
@@ -768,8 +771,10 @@ controls the default zeroing mode used when creating a thin pool.
\&
-The discard behavior of a thin pool LV determines how discard requests
-are handled. Possible discard behaviors:
+The discard behavior of a thin pool LV determines how discard requests are
+handled. Enabling discard under a file system may adversely affect the
+file system performance (see the section on fstrim for an alternative.)
+Possible discard behaviors:
ignore: Ignore any discards that are received.
@@ -933,7 +938,7 @@ and combines the two into a thin pool LV.
lvcreate -L LargeSize --thinpool VG/ThinPoolLV
Example
-# lvcreate -l1 --thinpool vg/pool0
+# lvcreate -L8M --thinpool vg/pool0
# lvs vg/pool0
LV VG Attr LSize Pool Origin Data%
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=90c44f5371b85edb…
Commit: 90c44f5371b85edb05d4c4ebbd9e0254971d13f4
Parent: 8b95c82fed667b4095b1358ac5697fd43cd61e11
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon May 12 14:12:55 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon May 12 16:24:40 2014 +0200
conf: document new thin_check option
---
conf/example.conf.in | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index d5ddb1c..bc1758d 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -693,8 +693,10 @@ global {
# option "-q" is for quiet output.
# With thin_check version 2.1 or newer you can add "--ignore-non-fatal-errors"
# to let it pass through ignorable errors and fix them later.
+ # With thin_check version 3.2 or newer you should add
+ # "--clear-needs-check-flag".
#
- # thin_check_options = [ "-q" ]
+ # thin_check_options = [ "-q", "--clear-needs-check-flag" ]
# Full path of the utility called to repair a thin metadata device
# is in a state that allows it to be used.
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2e1192f6914ddbe1…
Commit: 2e1192f6914ddbe1cf560a02158bdb58584efa26
Parent: 5b787a24f024d2589583fc356f343bb981c169e2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon May 12 14:51:23 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon May 12 16:24:39 2014 +0200
configure: improve needs_check thin_check test
Improve testing for needs_check - when old tools are installed,
issue proper warning from configure, but stop sending needs_check
flag to the old tool.
---
configure | 55 +++++++++++++++++++++++++++----------------------------
configure.in | 43 +++++++++++++++++++++----------------------
2 files changed, 48 insertions(+), 50 deletions(-)
diff --git a/configure b/configure
index 44eab6f..dd5ec64 100755
--- a/configure
+++ b/configure
@@ -7208,8 +7208,6 @@ $as_echo "#define THIN_INTERNAL 1" >>confdefs.h
*) as_fn_error $? "--with-thin parameter invalid ($THIN)" "$LINENO" 5 ;;
esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether thin_check supports the needs-check flag" >&5
-$as_echo_n "checking whether thin_check supports the needs-check flag... " >&6; }
# Check whether --enable-thin_check_needs_check was given.
if test "${enable_thin_check_needs_check+set}" = set; then :
enableval=$enable_thin_check_needs_check; THIN_CHECK_NEEDS_CHECK=$enableval
@@ -7217,14 +7215,6 @@ else
THIN_CHECK_NEEDS_CHECK=yes
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $THIN_CHECK_NEEDS_CHECK" >&5
-$as_echo "$THIN_CHECK_NEEDS_CHECK" >&6; }
-
-if test x$THIN_CHECK_NEEDS_CHECK = xyes; then
-
-$as_echo "#define THIN_CHECK_NEEDS_CHECK 1" >>confdefs.h
-
-fi
# Test if necessary thin tools are available
# if not - use plain defaults and warn user
@@ -7335,24 +7325,23 @@ fi
$as_echo "$as_me: WARNING: thin_check not found in path $PATH" >&2;}
THIN_CHECK_CMD=/usr/sbin/thin_check
THIN_CONFIGURE_WARN=y
- else
- if test x$THIN_CHECK_NEEDS_CHECK = xyes; then
- THIN_CHECK_VSN=`"$THIN_CHECK_CMD" -V 2>/dev/null`
- THIN_CHECK_VSN_MAJOR=`echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $1}'`
- THIN_CHECK_VSN_MINOR=`echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $2}'`
-
- if test -z "$THIN_CHECK_VSN_MAJOR" -o -z "$THIN_CHECK_VSN_MINOR" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found thin_check version \"$THIN_CHECK_VSN\"" >&5
-$as_echo "$as_me: WARNING: Found thin_check version \"$THIN_CHECK_VSN\"" >&2;}
- THIN_CHECK_VERSION_WARN=y
- else
- if test "$THIN_CHECK_VSN_MAJOR" -eq 0 -a "$THIN_CHECK_VSN_MINOR" -lt 3 ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found thin_check version \"$THIN_CHECK_VSN\"" >&5
-$as_echo "$as_me: WARNING: Found thin_check version \"$THIN_CHECK_VSN\"" >&2;}
- THIN_CHECK_VERSION_WARN=y
- fi
- fi
- fi
+ fi
+ fi
+ if test "$THIN_CHECK_NEEDS_CHECK" = yes; then
+ THIN_CHECK_VSN=`"$THIN_CHECK_CMD" -V 2>/dev/null`
+ THIN_CHECK_VSN_MAJOR=`echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $1}'`
+ THIN_CHECK_VSN_MINOR=`echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $2}'`
+
+ if test -z "$THIN_CHECK_VSN_MAJOR" -o -z "$THIN_CHECK_VSN_MINOR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $THIN_CHECK_CMD: Bad version \"$THIN_CHECK_VSN\" found" >&5
+$as_echo "$as_me: WARNING: $THIN_CHECK_CMD: Bad version \"$THIN_CHECK_VSN\" found" >&2;}
+ THIN_CHECK_VERSION_WARN=y
+ THIN_CHECK_NEEDS_CHECK=no
+ elif test "$THIN_CHECK_VSN_MAJOR" -eq 0 -a "$THIN_CHECK_VSN_MINOR" -lt 3; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $THIN_CHECK_CMD: Old version \"$THIN_CHECK_VSN\" found" >&5
+$as_echo "$as_me: WARNING: $THIN_CHECK_CMD: Old version \"$THIN_CHECK_VSN\" found" >&2;}
+ THIN_CHECK_VERSION_WARN=y
+ THIN_CHECK_NEEDS_CHECK=no
fi
fi
# Empty means a config way to ignore thin checking
@@ -7572,6 +7561,16 @@ $as_echo "$as_me: WARNING: thin_repair not found in path $PATH" >&2;}
;;
esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether thin_check supports the needs-check flag" >&5
+$as_echo_n "checking whether thin_check supports the needs-check flag... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $THIN_CHECK_NEEDS_CHECK" >&5
+$as_echo "$THIN_CHECK_NEEDS_CHECK" >&6; }
+if test "$THIN_CHECK_NEEDS_CHECK" = yes; then
+
+$as_echo "#define THIN_CHECK_NEEDS_CHECK 1" >>confdefs.h
+
+fi
+
cat >>confdefs.h <<_ACEOF
#define THIN_CHECK_CMD "$THIN_CHECK_CMD"
diff --git a/configure.in b/configure.in
index 09ca1b5..3a8e5d9 100644
--- a/configure.in
+++ b/configure.in
@@ -433,16 +433,10 @@ case "$THIN" in
esac
dnl -- thin_check needs-check flag
-AC_MSG_CHECKING(whether thin_check supports the needs-check flag)
AC_ARG_ENABLE(thin_check_needs_check,
AC_HELP_STRING([--disable-thin_check_needs_check],
[required if thin_check version is < 0.3.0]),
THIN_CHECK_NEEDS_CHECK=$enableval, THIN_CHECK_NEEDS_CHECK=yes)
-AC_MSG_RESULT($THIN_CHECK_NEEDS_CHECK)
-
-if test x$THIN_CHECK_NEEDS_CHECK = xyes; then
- AC_DEFINE([THIN_CHECK_NEEDS_CHECK], 1, [Define to 1 if the external 'thin_check' tool requires the --clear-needs-check-flag option])
-fi
# Test if necessary thin tools are available
# if not - use plain defaults and warn user
@@ -455,22 +449,21 @@ case "$THIN" in
AC_MSG_WARN([thin_check not found in path $PATH])
THIN_CHECK_CMD=/usr/sbin/thin_check
THIN_CONFIGURE_WARN=y
- else
- if test x$THIN_CHECK_NEEDS_CHECK = xyes; then
- THIN_CHECK_VSN=`"$THIN_CHECK_CMD" -V 2>/dev/null`
- THIN_CHECK_VSN_MAJOR=`echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $1}'`
- THIN_CHECK_VSN_MINOR=`echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $2}'`
-
- if test -z "$THIN_CHECK_VSN_MAJOR" -o -z "$THIN_CHECK_VSN_MINOR" ; then
- AC_MSG_WARN(Found thin_check version "$THIN_CHECK_VSN")
- THIN_CHECK_VERSION_WARN=y
- else
- if test "$THIN_CHECK_VSN_MAJOR" -eq 0 -a "$THIN_CHECK_VSN_MINOR" -lt 3 ; then
- AC_MSG_WARN(Found thin_check version "$THIN_CHECK_VSN")
- THIN_CHECK_VERSION_WARN=y
- fi
- fi
- fi
+ fi
+ fi
+ if test "$THIN_CHECK_NEEDS_CHECK" = yes; then
+ THIN_CHECK_VSN=`"$THIN_CHECK_CMD" -V 2>/dev/null`
+ THIN_CHECK_VSN_MAJOR=`echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $1}'`
+ THIN_CHECK_VSN_MINOR=`echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $2}'`
+
+ if test -z "$THIN_CHECK_VSN_MAJOR" -o -z "$THIN_CHECK_VSN_MINOR"; then
+ AC_MSG_WARN([$THIN_CHECK_CMD: Bad version "$THIN_CHECK_VSN" found])
+ THIN_CHECK_VERSION_WARN=y
+ THIN_CHECK_NEEDS_CHECK=no
+ elif test "$THIN_CHECK_VSN_MAJOR" -eq 0 -a "$THIN_CHECK_VSN_MINOR" -lt 3; then
+ AC_MSG_WARN([$THIN_CHECK_CMD: Old version "$THIN_CHECK_VSN" found])
+ THIN_CHECK_VERSION_WARN=y
+ THIN_CHECK_NEEDS_CHECK=no
fi
fi
# Empty means a config way to ignore thin checking
@@ -494,6 +487,12 @@ case "$THIN" in
;;
esac
+AC_MSG_CHECKING([whether thin_check supports the needs-check flag])
+AC_MSG_RESULT([$THIN_CHECK_NEEDS_CHECK])
+if test "$THIN_CHECK_NEEDS_CHECK" = yes; then
+ AC_DEFINE([THIN_CHECK_NEEDS_CHECK], 1, [Define to 1 if the external 'thin_check' tool requires the --clear-needs-check-flag option])
+fi
+
AC_DEFINE_UNQUOTED([THIN_CHECK_CMD], ["$THIN_CHECK_CMD"],
[The path to 'thin_check', if available.])