Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=683b1f0625a39084…
Commit: 683b1f0625a39084ed32ebce06a62d5a1fb4bf23
Parent: 668b669d5b40cb4a2d2ed62ebacb02ebeab03b98
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Nov 26 11:04:00 2012 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Nov 26 12:14:47 2012 +0100
thin: detect discards for non-power-2
Check if target supports discards for chunk sizes,
that are not power of 2 (just multiple of 64K),
and enable it in case it's supported by thin kernel target.
---
WHATS_NEW | 1 +
lib/activate/activate.h | 1 +
lib/thin/thin.c | 6 ++++++
3 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 2ea3f2b..068f453 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
+ Support discards for non-power-of-2 thin pool chunks.
Automatically restore MISSING PVs with no MDAs.
When no '-i' argument is given for RAID10, default to 2 stripes.
Do not allow --splitmirrors on RAID10 logical volumes.
diff --git a/lib/activate/activate.h b/lib/activate/activate.h
index ba24d2a..0a0c97e 100644
--- a/lib/activate/activate.h
+++ b/lib/activate/activate.h
@@ -51,6 +51,7 @@ enum {
THIN_FEATURE_EXTERNAL_ORIGIN = (1 << 1),
THIN_FEATURE_HELD_ROOT = (1 << 2),
THIN_FEATURE_BLOCK_SIZE = (1 << 3),
+ THIN_FEATURE_DISCARDS_NON_POWER_2 = (1 << 4),
};
void set_activation(int activation);
diff --git a/lib/thin/thin.c b/lib/thin/thin.c
index 2b6c71f..693b8b6 100644
--- a/lib/thin/thin.c
+++ b/lib/thin/thin.c
@@ -565,6 +565,12 @@ static int _thin_target_present(struct cmd_context *cmd,
/* FIXME Log this as WARNING later only if the user asked for the feature to be used but it's not present */
log_debug("Target " THIN_MODULE " does not support non power of 2 block sizes.");
+ if (maj >=1 && min >= 5)
+ _attrs |= THIN_FEATURE_DISCARDS_NON_POWER_2;
+ else
+ /* FIXME Log this as WARNING later only if the user asked for the feature to be used but it's not present */
+ log_debug("Target " THIN_MODULE " does not support discards for non power of 2 block sizes.");
+
_checked = 1;
}
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=60668f823e830ce3…
Commit: 60668f823e830ce39e452234996910c51728aa76
Parent: b3e9a09abefde12be2031235275f11d4a53dea11
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Sun Nov 25 20:41:56 2012 +0100
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Sun Nov 25 20:41:56 2012 +0100
Automatically restore MISSING PVs with no MDAs.
---
WHATS_NEW | 1 +
lib/format_text/import_vsn1.c | 6 ++++++
test/shell/nomda-restoremissing.sh | 31 +++++++++++++++++++++++++++++++
3 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 0904940..2ea3f2b 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
+ Automatically restore MISSING PVs with no MDAs.
When no '-i' argument is given for RAID10, default to 2 stripes.
Do not allow --splitmirrors on RAID10 logical volumes.
Skip mlocking [vectors] on arm architecture.
diff --git a/lib/format_text/import_vsn1.c b/lib/format_text/import_vsn1.c
index dff70f7..e73c475 100644
--- a/lib/format_text/import_vsn1.c
+++ b/lib/format_text/import_vsn1.c
@@ -221,6 +221,12 @@ static int _read_pv(struct format_instance *fid,
if (!pv->dev && !lvmetad_active())
pv->status |= MISSING_PV;
+ if ((pv->status & MISSING_PV) && pv->dev && pv_mda_used_count(pv) == 0) {
+ pv->status &= ~MISSING_PV;
+ log_info("Recovering a previously MISSING PV %s with no MDAs.",
+ pv_dev_name(pv));
+ }
+
/* Late addition */
if (dm_config_has_node(pvn, "dev_size") &&
!_read_uint64(pvn, "dev_size", &pv->size)) {
diff --git a/test/shell/nomda-restoremissing.sh b/test/shell/nomda-restoremissing.sh
new file mode 100644
index 0000000..8dd71fa
--- /dev/null
+++ b/test/shell/nomda-restoremissing.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+# Copyright (C) 2010 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_vg 3
+
+pvchange --metadataignore y $dev1
+
+lvcreate -m 1 -l 1 -n mirror $vg
+lvchange -a n $vg/mirror
+lvcreate -l 1 -n lv1 $vg "$dev1"
+
+# try to just change metadata; we expect the new version (with MISSING_PV set
+# on the reappeared volume) to be written out to the previously missing PV
+aux disable_dev "$dev1"
+lvremove $vg/mirror
+not vgck $vg 2>&1 | tee log
+grep "missing 1 physical volume" log
+not lvcreate -m 1 -l 1 -n mirror $vg # write operations fail
+aux enable_dev "$dev1"
+lvcreate -m 1 -l 1 -n mirror $vg # no MDA => automatically restored
+vgck $vg
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b3e9a09abefde12b…
Commit: b3e9a09abefde12be2031235275f11d4a53dea11
Parent: fb0cee9a66db6141ed331c8058d2c5c2c3a30cc1
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Wed Nov 21 18:46:52 2012 -0600
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Wed Nov 21 18:46:52 2012 -0600
RAID: If no stripes argument is given for RAID10 create, default to 2
Similar to the way the 'mirror', 'raid1' and 'raid10' segment types set
the number of mirrors to 2 ('-m 1') if the argument is not specified,
here we set the number of stripes to 2 if not given on the command line
when creating a RAID10 LV.
---
WHATS_NEW | 1 +
tools/lvcreate.c | 13 ++++++++++++-
2 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index a0504fc..0904940 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
+ When no '-i' argument is given for RAID10, default to 2 stripes.
Do not allow --splitmirrors on RAID10 logical volumes.
Skip mlocking [vectors] on arm architecture.
Support allocation of pool metadata with lvconvert command.
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index 801ff64..0d76bbe 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -493,13 +493,24 @@ static int _read_raid_params(struct lvcreate_params *lp,
* lp->stripes
* lp->stripe_size
*
- * For RAID 4/5/6, these values must be set.
+ * For RAID 4/5/6/10, these values must be set.
*/
if (!segtype_is_mirrored(lp->segtype) &&
(lp->stripes <= lp->segtype->parity_devs)) {
log_error("Number of stripes must be at least %d for %s",
lp->segtype->parity_devs + 1, lp->segtype->name);
return 0;
+ } else if (!strcmp(lp->segtype->name, "raid10") && (lp->stripes < 2)) {
+ if (arg_count(cmd, stripes_ARG)) {
+ /* User supplied the bad argument */
+ log_error("Segment type 'raid10' requires 2 or more stripes.");
+ return 0;
+ }
+ /* No stripe argument was given - default to 2 */
+ lp->stripes = 2;
+ lp->stripe_size = find_config_tree_int(cmd,
+ "metadata/stripesize",
+ DEFAULT_STRIPESIZE) * 2;
}
/*
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fb0cee9a66db6141…
Commit: fb0cee9a66db6141ed331c8058d2c5c2c3a30cc1
Parent: 400f6442861c6832f5f89d6e40e668517895b50d
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Wed Nov 21 18:39:26 2012 -0600
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Wed Nov 21 18:39:26 2012 -0600
RAID: Do not allow --splitmirrors on RAID10 logical volumes.
RAID10 does not have the ability to split off images for independent
use. So, 'lvconvert --splitmirrors' will not work and must be
disallowed.
---
WHATS_NEW | 1 +
lib/metadata/raid_manip.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index e96703c..a0504fc 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
+ Do not allow --splitmirrors on RAID10 logical volumes.
Skip mlocking [vectors] on arm architecture.
Support allocation of pool metadata with lvconvert command.
Move common functionality for thin lvcreate and lvconvert to toollib.
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index b9f75ff..8be0abe 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -1152,7 +1152,8 @@ int lv_raid_split(struct logical_volume *lv, const char *split_name,
return 0;
}
- if (!seg_is_mirrored(first_seg(lv))) {
+ if (!seg_is_mirrored(first_seg(lv)) ||
+ !strcmp(first_seg(lv)->segtype->name, "raid10")) {
log_error("Unable to split logical volume of segment type, %s",
first_seg(lv)->segtype->ops->name(first_seg(lv)));
return 0;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=400f6442861c6832…
Commit: 400f6442861c6832f5f89d6e40e668517895b50d
Parent: d5697b29ee009104a4ed91f79543e22cc8c8d2c4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Nov 21 09:46:18 2012 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Nov 21 12:15:09 2012 +0100
lv_manip: fix regresion from bf2741376d4
Commit bf2741376d47411994d4065863acab8e405ff5c7 started to use
lv_is_active() instead of call for lv_info & info.exists so
we cover also cluster activated devices.
For snapshost the conversion was not correct and introduced
regression by blocking creation of snapshot of inactive LV.
Fix it by assigning lv_is_active() directly.
Note: we still have minor issue to fix - to make
lv_is_???? function able to return error states since
lv_info() may fail.
---
lib/metadata/lv_manip.c | 10 ++--------
test/shell/lvcreate-usage.sh | 2 ++
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index dc315ac..35a75ff 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -4367,14 +4367,8 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l
log_warn("WARNING: See global/mirror_segtype_default in lvm.conf.");
}
- if (!lv_is_active(org)) {
- log_error("Check for existence of active snapshot "
- "origin '%s' failed.", org->name);
- return NULL;
- }
- origin_active = 1;
-
- if (vg_is_clustered(vg) &&
+ if ((origin_active = lv_is_active(org)) &&
+ vg_is_clustered(vg) &&
!lv_is_active_exclusive_locally(org)) {
log_error("%s must be active exclusively to"
" create snapshot", org->name);
diff --git a/test/shell/lvcreate-usage.sh b/test/shell/lvcreate-usage.sh
index ddde401..c9c906a 100644
--- a/test/shell/lvcreate-usage.sh
+++ b/test/shell/lvcreate-usage.sh
@@ -64,6 +64,8 @@ lvcreate -l1 -n $lv3 $vg
not lvcreate -l1 -n $lv4 $vg
lvremove -ff $vg/$lv3
+# check snapshot of inactive origin
+lvchange -an $vg/$lv1
lvcreate -l1 -s -n $lv3 $vg/$lv1
not lvcreate -l1 -n $lv4 $vg
not lvcreate -l1 -m1 -n $lv4 $vg