Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f5a205668b9965a7…
Commit: f5a205668b9965a7a2471d9e7cbcd3db49a495c7
Parent: cb9256111a8635b354c5b0ac3f3ab8fdab6068e3
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Wed Jul 24 14:18:07 2013 -0500
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Wed Jul 24 14:18:07 2013 -0500
Revert a previous change
commit d00d45a8b609d50302c94a0fff20849f0cc13a48 introduced changes
that are causing cluster mirror tests to fail. Ultimately, I think
the change was right, but a proper clean-up will have to wait.
The portion of the commit we are reverting correlates to the
following commit comment:
2) lib/metadata/mirror.c:_delete_lv() - should have been calling
_activate_lv_like_model() with 'mirror_lv'. This is because
'mirror_lv' is the LV that the overall operation is being
performed on. We need to use this LV as the basis for
determining whether to activate locally, or across the
cluster, etc.
It appears that when legs or logs are removed from a mirror, they
are being activated before they are deleted in order to make them
top-level LVs that can be acted upon. When doing this, it appears
they are not activated based on the characteristics of the mirror
from which they came. IOW, if the mirror was exclusively active,
the sub-LVs are activated globally. This is a no-no. This then
made it impossible to activate_lv_like_model if the model was
"mirror_lv" instead of "lv" in _delete_lv(). Thus, at some point
this change should probably be put back and those location where
the sub-LVs are being improperly activated "shared" instead of
EX should be corrected.
---
lib/metadata/mirror.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c
index 8748d89..24c9786 100644
--- a/lib/metadata/mirror.c
+++ b/lib/metadata/mirror.c
@@ -434,7 +434,8 @@ static int _delete_lv(struct logical_volume *mirror_lv, struct logical_volume *l
}
}
- if (!_activate_lv_like_model(mirror_lv, lv))
+ /* FIXME: the 'model' should be 'mirror_lv' not 'lv', I think. */
+ if (!_activate_lv_like_model(lv, lv))
return_0;
/* FIXME Is this superfluous now? */
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d00d45a8b609d503…
Commit: d00d45a8b609d50302c94a0fff20849f0cc13a48
Parent: a2b51476007aae91acfc121a7fd2ce04f3b08781
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Tue Jul 23 14:46:22 2013 -0500
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Tue Jul 23 14:46:22 2013 -0500
Clean-up: Addressing a few FIXME's
Three fixme's addressed in this commit:
1) lib/metadata/lv_manip.c:_calc_area_multiple() - this could be
safely changed to a comment explaining that currently because
RAID10 can only have a 2-way mirror, we don't need to know the
number of stripes. However, we will need to know that in the
future if RAID10 is to support more than 2-way mirroring.
2) lib/metadata/mirror.c:_delete_lv() - should have been calling
_activate_lv_like_model() with 'mirror_lv'. This is because
'mirror_lv' is the LV that the overall operation is being
performed on. We need to use this LV as the basis for
determining whether to activate locally, or across the
cluster, etc.
3) tools/lvcreate.c:_lvcreate_params() - Minor clean-up. If
'-m 0' is given, treat it as though the mirroring argument
was not given (i.e. as though the requested segment type
was 'stripe' and not mirror).
---
lib/metadata/lv_manip.c | 11 ++++++++---
lib/metadata/mirror.c | 3 +--
tools/lvcreate.c | 7 +++----
3 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 9284c7b..8fea33d 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -846,7 +846,8 @@ struct alloc_handle {
};
static uint32_t _calc_area_multiple(const struct segment_type *segtype,
- const uint32_t area_count, const uint32_t stripes)
+ const uint32_t area_count,
+ const uint32_t stripes)
{
if (!area_count)
return 1;
@@ -868,9 +869,13 @@ static uint32_t _calc_area_multiple(const struct segment_type *segtype,
return area_count - segtype->parity_devs;
}
- /* RAID10 - only has 2-way mirror right now */
+ /*
+ * RAID10 - only has 2-way mirror right now.
+ * If we are to move beyond 2-way RAID10, then
+ * the 'stripes' argument will always need to
+ * be given.
+ */
if (!strcmp(segtype->name, "raid10")) {
- // FIXME: I'd like the 'stripes' arg always given
if (!stripes)
return area_count / 2;
return stripes;
diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c
index 4f36e0d..8748d89 100644
--- a/lib/metadata/mirror.c
+++ b/lib/metadata/mirror.c
@@ -434,8 +434,7 @@ static int _delete_lv(struct logical_volume *mirror_lv, struct logical_volume *l
}
}
- // FIXME: shouldn't the activation type be based on mirror_lv, not lv?
- if (!_activate_lv_like_model(lv, lv))
+ if (!_activate_lv_like_model(mirror_lv, lv))
return_0;
/* FIXME Is this superfluous now? */
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index 2e8c65f..8564613 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -735,10 +735,9 @@ static int _lvcreate_params(struct lvcreate_params *lp,
return 0;
}
-// FIXME -m0 implies *striped*
-
- /* Set default segtype */
- if (arg_count(cmd, mirrors_ARG))
+ /* Set default segtype - remember, '-m 0' implies stripe. */
+ if (arg_count(cmd, mirrors_ARG) &&
+ arg_uint_value(cmd, mirrors_ARG, 0))
if (arg_uint_value(cmd, arg_count(cmd, stripes_long_ARG) ?
stripes_long_ARG : stripes_ARG, 1) > 1) {
segtype_str = find_config_tree_str(cmd, global_raid10_segtype_default_CFG, NULL);;