master - segtypes: Further segtype macros.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b66fa91c46f880...
Commit: b66fa91c46f88029eb730f07524d2c09a4ded559
Parent: b1b0b134ecd55fad004d56301c52b32234db3c9a
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Fri Aug 5 14:00:08 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Fri Aug 5 14:00:40 2016 +0100
segtypes: Further segtype macros.
---
lib/metadata/lv_manip.c | 2 ++
lib/metadata/segtype.c | 2 +-
lib/metadata/segtype.h | 14 ++++++++++++++
3 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index a465c4c..d74c571 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -119,6 +119,7 @@ enum {
LV_TYPE_RAID10,
LV_TYPE_RAID4,
LV_TYPE_RAID5,
+ LV_TYPE_RAID5_N,
LV_TYPE_RAID5_LA,
LV_TYPE_RAID5_RA,
LV_TYPE_RAID5_LS,
@@ -169,6 +170,7 @@ static const char *_lv_type_names[] = {
[LV_TYPE_RAID10] = SEG_TYPE_NAME_RAID10,
[LV_TYPE_RAID4] = SEG_TYPE_NAME_RAID4,
[LV_TYPE_RAID5] = SEG_TYPE_NAME_RAID5,
+ [LV_TYPE_RAID5_N] = SEG_TYPE_NAME_RAID5_N,
[LV_TYPE_RAID5_LA] = SEG_TYPE_NAME_RAID5_LA,
[LV_TYPE_RAID5_RA] = SEG_TYPE_NAME_RAID5_RA,
[LV_TYPE_RAID5_LS] = SEG_TYPE_NAME_RAID5_LS,
diff --git a/lib/metadata/segtype.c b/lib/metadata/segtype.c
index 35823d9..b66ab02 100644
--- a/lib/metadata/segtype.c
+++ b/lib/metadata/segtype.c
@@ -47,7 +47,7 @@ struct segment_type *get_segtype_from_flag(struct cmd_context *cmd, uint64_t fla
if (flag & segtype->flags)
return segtype;
- log_error(INTERNAL_ERROR "Unrecognised segment type flag 0x%" PRIx64, flag);
+ log_error(INTERNAL_ERROR "Unrecognised segment type flag 0x%016" PRIx64, flag);
return NULL;
}
diff --git a/lib/metadata/segtype.h b/lib/metadata/segtype.h
index 0da2d94..2fafa19 100644
--- a/lib/metadata/segtype.h
+++ b/lib/metadata/segtype.h
@@ -90,6 +90,7 @@ struct dev_manager;
#define SEG_TYPE_NAME_RAID10 "raid10"
#define SEG_TYPE_NAME_RAID4 "raid4"
#define SEG_TYPE_NAME_RAID5 "raid5"
+#define SEG_TYPE_NAME_RAID5_N "raid5_n"
#define SEG_TYPE_NAME_RAID5_LA "raid5_la"
#define SEG_TYPE_NAME_RAID5_LS "raid5_ls"
#define SEG_TYPE_NAME_RAID5_RA "raid5_ra"
@@ -98,6 +99,11 @@ struct dev_manager;
#define SEG_TYPE_NAME_RAID6_NC "raid6_nc"
#define SEG_TYPE_NAME_RAID6_NR "raid6_nr"
#define SEG_TYPE_NAME_RAID6_ZR "raid6_zr"
+#define SEG_TYPE_NAME_RAID6_LA_6 "raid6_la_6"
+#define SEG_TYPE_NAME_RAID6_LS_6 "raid6_ls_6"
+#define SEG_TYPE_NAME_RAID6_RA_6 "raid6_ra_6"
+#define SEG_TYPE_NAME_RAID6_RS_6 "raid6_rs_6"
+#define SEG_TYPE_NAME_RAID6_N_6 "raid6_n_6"
#define segtype_is_linear(segtype) (!strcmp(segtype->name, SEG_TYPE_NAME_LINEAR))
#define segtype_is_striped_target(segtype) ((segtype)->flags & SEG_STRIPED_TARGET ? 1 : 0)
@@ -114,6 +120,7 @@ struct dev_manager;
#define segtype_is_raid4(segtype) ((segtype)->flags & SEG_RAID4 ? 1 : 0)
#define segtype_is_any_raid5(segtype) ((segtype)->flags & \
(SEG_RAID5_LS|SEG_RAID5_LA|SEG_RAID5_RS|SEG_RAID5_RA|SEG_RAID5_N) ? 1 : 0)
+#define segtype_is_raid5_n(segtype) ((segtype)->flags & SEG_RAID5_N ? 1 : 0)
#define segtype_is_raid5_la(segtype) ((segtype)->flags & SEG_RAID5_LA ? 1 : 0)
#define segtype_is_raid5_ra(segtype) ((segtype)->flags & SEG_RAID5_RA ? 1 : 0)
#define segtype_is_raid5_ls(segtype) ((segtype)->flags & SEG_RAID5_LS ? 1 : 0)
@@ -123,8 +130,11 @@ struct dev_manager;
SEG_RAID6_LA_6|SEG_RAID6_LS_6|SEG_RAID6_RA_6|SEG_RAID6_RS_6|SEG_RAID6_N_6) ? 1 : 0)
#define segtype_is_raid6_nc(segtype) ((segtype)->flags & SEG_RAID6_NC ? 1 : 0)
#define segtype_is_raid6_nr(segtype) ((segtype)->flags & SEG_RAID6_NR ? 1 : 0)
+#define segtype_is_raid6_n_6(segtype) ((segtype)->flags & SEG_RAID6_N_6 ? 1 : 0)
#define segtype_is_raid6_zr(segtype) ((segtype)->flags & SEG_RAID6_ZR ? 1 : 0)
+#define segtype_is_any_raid10(segtype) ((segtype)->flags & SEG_RAID10 ? 1 : 0)
#define segtype_is_raid10(segtype) ((segtype)->flags & SEG_RAID10 ? 1 : 0)
+#define segtype_is_raid10_near(segtype) segtype_is_raid10(segtype)
#define segtype_is_raid_with_meta(segtype) (segtype_is_raid(segtype) && !segtype_is_raid0(segtype))
#define segtype_is_snapshot(segtype) ((segtype)->flags & SEG_SNAPSHOT ? 1 : 0)
#define segtype_is_striped(segtype) ((segtype)->flags & SEG_AREAS_STRIPED ? 1 : 0)
@@ -154,6 +164,7 @@ struct dev_manager;
#define seg_is_raid1(seg) segtype_is_raid1((seg)->segtype)
#define seg_is_raid4(seg) segtype_is_raid4((seg)->segtype)
#define seg_is_any_raid5(seg) segtype_is_any_raid5((seg)->segtype)
+#define seg_is_raid5_n(seg) segtype_is_raid5_n((seg)->segtype)
#define seg_is_raid5_la(seg) segtype_is_raid5_la((seg)->segtype)
#define seg_is_raid5_ra(seg) segtype_is_raid5_ra((seg)->segtype)
#define seg_is_raid5_ls(seg) segtype_is_raid5_ls((seg)->segtype)
@@ -162,7 +173,10 @@ struct dev_manager;
#define seg_is_raid6_zr(seg) segtype_is_raid6_zr((seg)->segtype)
#define seg_is_raid6_nr(seg) segtype_is_raid6_nr((seg)->segtype)
#define seg_is_raid6_nc(seg) segtype_is_raid6_nc((seg)->segtype)
+#define seg_is_raid6_n_6(seg) segtype_is_raid6_n_6((seg)->segtype)
+#define seg_is_any_raid10(seg) segtype_is_any_raid10((seg)->segtype)
#define seg_is_raid10(seg) segtype_is_raid10((seg)->segtype)
+#define seg_is_raid10_near(seg) segtype_is_raid10_near((seg)->segtype)
#define seg_is_raid_with_meta(seg) segtype_is_raid_with_meta((seg)->segtype)
#define seg_is_replicator(seg) ((seg)->segtype->flags & SEG_REPLICATOR ? 1 : 0)
#define seg_is_replicator_dev(seg) ((seg)->segtype->flags & SEG_REPLICATOR_DEV ? 1 : 0)
7 years, 9 months
master - raid0: Validate presence of raid0 meta_areas more tightly.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b1b0b134ecd55f...
Commit: b1b0b134ecd55fad004d56301c52b32234db3c9a
Parent: d1a25fe597569fd15fd934f639d41d991d767219
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Thu Aug 4 21:13:36 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Thu Aug 4 21:15:07 2016 +0100
raid0: Validate presence of raid0 meta_areas more tightly.
---
lib/metadata/merge.c | 7 ++++++-
lib/metadata/raid_manip.c | 9 ++++++---
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/lib/metadata/merge.c b/lib/metadata/merge.c
index 05cef17..ce33e28 100644
--- a/lib/metadata/merge.c
+++ b/lib/metadata/merge.c
@@ -97,6 +97,9 @@ static void _check_raid0_seg(struct lv_segment *seg, int *error_count)
if (seg_is_raid0_meta(seg) &&
!seg->meta_areas)
raid_seg_error("no meta areas");
+ if (!seg_is_raid0_meta(seg) &&
+ seg->meta_areas)
+ raid_seg_error("meta areas");
if (!seg->stripe_size)
raid_seg_error("zero stripe size");
if (!is_power_of_2(seg->stripe_size))
@@ -289,8 +292,10 @@ static void _check_raid_seg(struct lv_segment *seg, int *error_count)
/* Check for any MetaLV flaws like non-existing ones or size variations */
if (seg->meta_areas)
for (area_len = s = 0; s < seg->area_count; s++) {
- if (seg_metatype(seg, s) != AREA_LV)
+ if (seg_metatype(seg, s) != AREA_LV) {
raid_seg_error("no MetaLV");
+ continue;
+ }
if (!lv_is_raid_metadata(seg_metalv(seg, s)))
raid_seg_error("MetaLV without RAID metadata flag");
if (area_len &&
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 1c03d37..109cb2e 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -1701,7 +1701,8 @@ static int _extract_image_component_list(struct lv_segment *seg,
*/
static int _alloc_rmeta_devs_for_lv(struct logical_volume *lv,
struct dm_list *meta_lvs,
- struct dm_list *allocate_pvs)
+ struct dm_list *allocate_pvs,
+ struct lv_segment_area **seg_meta_areas)
{
uint32_t s;
struct lv_list *lvl_array;
@@ -1710,7 +1711,7 @@ static int _alloc_rmeta_devs_for_lv(struct logical_volume *lv,
dm_list_init(&data_lvs);
- if (!(seg->meta_areas = dm_pool_zalloc(lv->vg->vgmem, seg->area_count * sizeof(*seg->meta_areas))))
+ if (!(*seg_meta_areas = dm_pool_zalloc(lv->vg->vgmem, seg->area_count * sizeof(*seg->meta_areas))))
return 0;
if (!(lvl_array = dm_pool_alloc(lv->vg->vgmem, seg->area_count * sizeof(*lvl_array))))
@@ -1736,11 +1737,12 @@ static int _alloc_and_add_rmeta_devs_for_lv(struct logical_volume *lv, struct dm
{
struct lv_segment *seg = first_seg(lv);
struct dm_list meta_lvs;
+ struct lv_segment_area *seg_meta_areas;
dm_list_init(&meta_lvs);
log_debug_metadata("Allocating metadata LVs for %s", display_lvname(lv));
- if (!_alloc_rmeta_devs_for_lv(lv, &meta_lvs, allocate_pvs)) {
+ if (!_alloc_rmeta_devs_for_lv(lv, &meta_lvs, allocate_pvs, &seg_meta_areas)) {
log_error("Failed to allocate metadata LVs for %s", display_lvname(lv));
return_0;
}
@@ -1753,6 +1755,7 @@ static int _alloc_and_add_rmeta_devs_for_lv(struct logical_volume *lv, struct dm
}
/* Set segment areas for metadata sub_lvs */
+ seg->meta_areas = seg_meta_areas;
log_debug_metadata("Adding newly allocated metadata LVs to %s", display_lvname(lv));
if (!_add_image_component_list(seg, 1, 0, &meta_lvs, 0)) {
log_error("Failed to add newly allocated metadata LVs to %s", display_lvname(lv));
7 years, 9 months
master - lvconvert: add FIXME
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d1a25fe597569f...
Commit: d1a25fe597569fd15fd934f639d41d991d767219
Parent: 4a15abe865c7087de5505388e9757623da282311
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Aug 4 11:40:27 2016 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Aug 4 13:01:48 2016 -0500
lvconvert: add FIXME
operations are no longer identified correctly.
---
tools/lvconvert.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 8ea293d..5731558 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -4337,7 +4337,14 @@ static int _convert_striped(struct cmd_context *cmd, struct logical_volume *lv,
* for each arg_is_set(operation)
* _convert_lvtype_operation();
*
+ * FIXME: this code (identifying/routing each unique operation through
+ * _convert_lvtype_op) was designed to work based on the new type that
+ * the user entered after --type, not the final segment type in lp->type_str.
+ * Sometimes the two differ because tricks are played with lp->type_str.
+ * So, when the use of arg_type_str(type_ARG) here was replaced with
+ * lp->type_str, some commands are no longer identified/routed correctly.
*/
+
static int _lvconvert(struct cmd_context *cmd, struct logical_volume *lv,
struct lvconvert_params *lp)
{
7 years, 9 months
master - striped: Add precise macros for original segtype.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4a15abe865c708...
Commit: 4a15abe865c7087de5505388e9757623da282311
Parent: 5c3141a8b9f2a4d67ca50674bc1bfec20fdc9e09
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Thu Aug 4 01:24:39 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Thu Aug 4 01:24:39 2016 +0100
striped: Add precise macros for original segtype.
The existing striped macros include raid0 segments.
---
lib/metadata/raid_manip.c | 8 ++++----
lib/metadata/segtype.h | 4 ++++
lib/striped/striped.c | 2 +-
tools/lvconvert.c | 3 +--
4 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 9da05e5..1c03d37 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -2253,7 +2253,7 @@ static int _takeover_unsupported(TAKEOVER_FN_ARGS)
{
log_error("Converting the segment type for %s from %s to %s is not supported.",
display_lvname(lv), lvseg_name(first_seg(lv)),
- (segtype_is_striped(new_segtype) && !segtype_is_any_raid0(new_segtype) &&
+ (segtype_is_striped_target(new_segtype) &&
(new_stripes == 1)) ? SEG_TYPE_NAME_LINEAR : new_segtype->name);
return 0;
@@ -2263,7 +2263,7 @@ static int _takeover_unsupported_yet(const struct logical_volume *lv, const unsi
{
log_error("Converting the segment type for %s from %s to %s is not supported yet.",
display_lvname(lv), lvseg_name(first_seg(lv)),
- (segtype_is_striped(new_segtype) && !segtype_is_any_raid0(new_segtype) &&
+ (segtype_is_striped_target(new_segtype) &&
(new_stripes == 1)) ? SEG_TYPE_NAME_LINEAR : new_segtype->name);
return 0;
@@ -2701,7 +2701,7 @@ static unsigned _segtype_ix(const struct segment_type *segtype, uint32_t area_co
int i = 2, j;
/* Linear special case */
- if (segtype_is_striped(segtype) && !segtype_is_any_raid0(segtype)) {
+ if (segtype_is_striped_target(segtype)) {
if (area_count == 1)
return 0; /* linear */
return 1; /* striped */
@@ -2772,7 +2772,7 @@ int lv_raid_convert(struct logical_volume *lv,
log_verbose("Converting %s from %s to %s.",
display_lvname(lv), lvseg_name(first_seg(lv)),
- (segtype_is_striped(new_segtype) && !segtype_is_any_raid0(new_segtype) &&
+ (segtype_is_striped_target(new_segtype) &&
(new_stripes == 1)) ? SEG_TYPE_NAME_LINEAR : new_segtype->name);
/* FIXME If not active, prompt and activate */
diff --git a/lib/metadata/segtype.h b/lib/metadata/segtype.h
index bf7c5eb..0da2d94 100644
--- a/lib/metadata/segtype.h
+++ b/lib/metadata/segtype.h
@@ -68,6 +68,8 @@ struct dev_manager;
#define SEG_RAID6_N_6 0x0000000800000000ULL
#define SEG_RAID6 SEG_RAID6_ZR
+#define SEG_STRIPED_TARGET 0x0000008000000000ULL
+
#define SEG_UNKNOWN 0x8000000000000000ULL
#define SEG_TYPE_NAME_LINEAR "linear"
@@ -98,6 +100,7 @@ struct dev_manager;
#define SEG_TYPE_NAME_RAID6_ZR "raid6_zr"
#define segtype_is_linear(segtype) (!strcmp(segtype->name, SEG_TYPE_NAME_LINEAR))
+#define segtype_is_striped_target(segtype) ((segtype)->flags & SEG_STRIPED_TARGET ? 1 : 0)
#define segtype_is_cache(segtype) ((segtype)->flags & SEG_CACHE ? 1 : 0)
#define segtype_is_cache_pool(segtype) ((segtype)->flags & SEG_CACHE_POOL ? 1 : 0)
#define segtype_is_mirrored(segtype) ((segtype)->flags & SEG_AREAS_MIRRORED ? 1 : 0)
@@ -137,6 +140,7 @@ struct dev_manager;
segtype_is_thin(segtype) || segtype_is_snapshot(segtype) || \
(segtype_is_raid(segtype) && !segtype_is_raid1(segtype))) ? 1 : 0)
+#define seg_is_striped_target(seg) segtype_is_striped_target((seg)->segtype)
#define seg_is_cache(seg) segtype_is_cache((seg)->segtype)
#define seg_is_cache_pool(seg) segtype_is_cache_pool((seg)->segtype)
#define seg_is_linear(seg) (seg_is_striped(seg) && ((seg)->area_count == 1))
diff --git a/lib/striped/striped.c b/lib/striped/striped.c
index 530e48e..7d19786 100644
--- a/lib/striped/striped.c
+++ b/lib/striped/striped.c
@@ -233,7 +233,7 @@ struct segment_type *init_striped_segtype(struct cmd_context *cmd)
segtype->ops = &_striped_ops;
segtype->name = SEG_TYPE_NAME_STRIPED;
- segtype->flags =
+ segtype->flags = SEG_STRIPED_TARGET |
SEG_CAN_SPLIT | SEG_AREAS_STRIPED | SEG_FORMAT1_SUPPORT;
log_very_verbose("Initialised segtype: %s", segtype->name);
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 0aac89e..8ea293d 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -1925,8 +1925,7 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
return 0;
}
- if (!seg_is_striped(seg) && !seg_is_any_raid0(seg) &&
- !lv_raid_percent(lv, &sync_percent)) {
+ if (!seg_is_striped(seg) && !lv_raid_percent(lv, &sync_percent)) {
log_error("Unable to determine sync status of %s.",
display_lvname(lv));
return 0;
7 years, 9 months
master - lvconvert: Improve error message when no -m.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5c3141a8b9f2a4...
Commit: 5c3141a8b9f2a4d67ca50674bc1bfec20fdc9e09
Parent: be497175e03b5cb51f2972a84528216bba06412a
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Wed Aug 3 23:31:50 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Wed Aug 3 23:43:59 2016 +0100
lvconvert: Improve error message when no -m.
---
tools/lvconvert.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index b365049..0aac89e 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -1853,7 +1853,12 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
}
if (seg_is_linear(seg) && !lp->merge_mirror && !lp->mirrors_supplied) {
- log_error("Raid conversions require -m/--mirrors.");
+ if (_raid0_type_requested(lp->type_str))
+ log_error("Linear LV %s cannot be converted to %s.",
+ display_lvname(lv), lp->type_str);
+ else
+ log_error("Raid conversions of LV %s require -m/--mirrors.",
+ display_lvname(lv));
goto try_new_takeover_or_reshape;
}
7 years, 9 months
master - lvconvert: Improve error message when no -m.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5c3141a8b9f2a4...
Commit: 5c3141a8b9f2a4d67ca50674bc1bfec20fdc9e09
Parent: be497175e03b5cb51f2972a84528216bba06412a
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Wed Aug 3 23:31:50 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Wed Aug 3 23:43:59 2016 +0100
lvconvert: Improve error message when no -m.
---
tools/lvconvert.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index b365049..0aac89e 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -1853,7 +1853,12 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
}
if (seg_is_linear(seg) && !lp->merge_mirror && !lp->mirrors_supplied) {
- log_error("Raid conversions require -m/--mirrors.");
+ if (_raid0_type_requested(lp->type_str))
+ log_error("Linear LV %s cannot be converted to %s.",
+ display_lvname(lv), lp->type_str);
+ else
+ log_error("Raid conversions of LV %s require -m/--mirrors.",
+ display_lvname(lv));
goto try_new_takeover_or_reshape;
}
7 years, 9 months
master - lvconvert: Improve error message when no -m.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5de760f00de53c...
Commit: 5de760f00de53c8035a0313f7d19ecf7e93916db
Parent: be497175e03b5cb51f2972a84528216bba06412a
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Wed Aug 3 23:31:50 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Wed Aug 3 23:31:50 2016 +0100
lvconvert: Improve error message when no -m.
---
tools/lvconvert.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index b365049..6919493 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -1853,7 +1853,12 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
}
if (seg_is_linear(seg) && !lp->merge_mirror && !lp->mirrors_supplied) {
- log_error("Raid conversions require -m/--mirrors.");
+ if (_raid0_type_requested(lp->type_str))
+ log_error("Linear LV %s cannot be converted to %s.",
+ display_lvname(lv), lp->type_str);
+ else
+ log_error("Raid conversions of LV %s require -m/--mirrors.",
+ display_lvname(lv));
goto try_new_takeover_or_reshape;
}
@@ -1898,7 +1903,7 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
if (segtype_is_any_raid0(lp->segtype) &&
!(lp->target_attr & RAID_FEATURE_RAID0)) {
log_error("RAID module does not support RAID0.");
- return 0;
+ //return 0;
}
if (!lv_raid_convert(lv, lp->segtype, lp->yes, lp->force, lp->stripes, lp->stripe_size,
lp->region_size, lp->pvh))
7 years, 9 months
master - man: minor corrections in pvscan
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=be497175e03b5c...
Commit: be497175e03b5cb51f2972a84528216bba06412a
Parent: 2b01dca28aca71af1388e96d4ed3627d352d9399
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Aug 3 15:49:43 2016 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Aug 3 15:49:43 2016 -0500
man: minor corrections in pvscan
---
man/pvscan.8.in | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/man/pvscan.8.in b/man/pvscan.8.in
index 38f424f..5ff5fa5 100644
--- a/man/pvscan.8.in
+++ b/man/pvscan.8.in
@@ -79,7 +79,7 @@ When given specific device name arguments, pvscan \-\-cache will only
read the named devices.
.IP \[bu] 2
-LVM udev rules and systemd services are used to intiate automatic device
+LVM udev rules and systemd services are used to initiate automatic device
scanning.
.IP \[bu] 2
@@ -99,8 +99,8 @@ if the global_filter has changed, then all devices must be rescanned
for metadata with the command pvscan \-\-cache.
.IP \[bu] 2
-lvmetad ignores older metadata formats, e.g. lvm1, and should not be
-used if they exist.
+lvmetad does not cache older metadata formats, e.g. lvm1, and will
+be temporarily disabled if they are seen.
.IP \[bu] 2
To notify lvmetad about a device that is no longer present, the major and
7 years, 9 months
master - man: include info about disabled lvmetad
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2b01dca28aca71...
Commit: 2b01dca28aca71af1388e96d4ed3627d352d9399
Parent: 8b1a368b59f0759dca84be663663011622b0cd99
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Aug 3 15:39:43 2016 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Aug 3 15:42:12 2016 -0500
man: include info about disabled lvmetad
---
man/lvmetad.8.in | 38 ++++++++++++++++++++++++--------------
1 files changed, 24 insertions(+), 14 deletions(-)
diff --git a/man/lvmetad.8.in b/man/lvmetad.8.in
index 3e895ce..c665e18 100644
--- a/man/lvmetad.8.in
+++ b/man/lvmetad.8.in
@@ -19,35 +19,45 @@ lvmetad \(em LVM metadata cache daemon
.SH DESCRIPTION
-The lvmetad daemon caches LVM metadata, so that LVM commands can read
-metadata without scanning disks.
-
-Metadata caching can be an advantage because scanning disks is time
-consuming and may interfere with the normal work of the system and disks.
-
-lvmetad does not read metadata from disks itself. The 'pvscan \-\-cache'
-command scans disks, reads the LVM metadata and sends it to lvmetad.
-
-New LVM disks that appear on the system must be scanned by pvscan before
-lvmetad knows about them. If lvmetad does not know about a disk, then LVM
+The lvmetad daemon caches LVM metadata so that LVM commands can read
+metadata from the cache rather than scanning disks. This can be an
+advantage because scanning disks is time consuming and may interfere with
+the normal work of the system. lvmetad can be a disadvantage when disk
+event notifications from the system are unreliable.
+
+lvmetad does not read metadata from disks itself. Instead, it relies on
+an LVM command, like pvscan \-\-cache, to read metadata from disks and
+send it to lvmetad to be cached.
+
+New LVM disks that appear on the system must be scanned before lvmetad
+knows about them. If lvmetad does not know about a disk, then LVM
commands using lvmetad will also not know about it. When disks are added
or removed from the system, lvmetad must be updated.
-lvmetad is usually combined with event-based system services that
-automatically run pvscan \-\-cache on new disks. This way, the lvmetad
-cache is automatically updated with metadata from new disks when they
+lvmetad is usually combined with event\-based system services that
+automatically run pvscan \-\-cache on disks added or removed. This way,
+the cache is automatically updated with metadata from new disks when they
appear. LVM udev rules and systemd services implement this automation.
Automatic scanning is usually combined with automatic activation. For
more information, see
.BR pvscan (8).
If lvmetad is started or restarted after disks have been added to the
-system, or if the global_filter has changed, the cache must be updated by
-running 'pvscan \-\-cache'.
+system, or if the global_filter has changed, the cache must be updated.
+This can be done by running pvscan \-\-cache, or it will be done
+automatically by the next LVM command that's run.
When lvmetad is not used, LVM commands revert to scanning disks for LVM
metadata.
+In some cases, lvmetad will be temporarily disabled while it continues
+running. In this state, LVM commands will ignore the lvmetad cache and
+revert to scanning disks. A warning will also be printed which includes
+the reason why lvmetad is not being used. The most common reason is the
+existence of duplicate PVs (lvmetad cannot cache data for duplicate PVs.)
+Once duplicates have been resolved, the lvmetad cache is can be updated
+with pvscan \-\-cache and commands will return to using the cache.
+
Use of lvmetad is enabled/disabled by:
.br
.BR lvm.conf (5)
7 years, 9 months
master - lvconvert: Provide entry point for new functionality.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8b1a368b59f075...
Commit: 8b1a368b59f0759dca84be663663011622b0cd99
Parent: fdc3fcbfceb6282312e79200286be29ae08a5765
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Wed Aug 3 03:53:29 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Wed Aug 3 03:53:29 2016 +0100
lvconvert: Provide entry point for new functionality.
Prepare for new segment type conversion functionality in cases that
currently fail. In the short-term, we need to do this while limiting
the changes to the code paths for the conversions that are already
supported.
---
tools/lvconvert.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index d5eaee4..b365049 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -1839,7 +1839,7 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
if (lp->mirrors_supplied && !seg_is_mirrored(seg) && !seg_is_linear(seg)) {
log_error("'--mirrors/-m' is not compatible with %s.",
lvseg_name(seg));
- return 0;
+ goto try_new_takeover_or_reshape;
}
if (!_lvconvert_validate_thin(lv, lp))
@@ -1849,12 +1849,12 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
log_error("Unable to convert %s from %s to %s.",
display_lvname(lv), lvseg_name(seg),
lp->segtype->name);
- return 0;
+ goto try_new_takeover_or_reshape;
}
if (seg_is_linear(seg) && !lp->merge_mirror && !lp->mirrors_supplied) {
log_error("Raid conversions require -m/--mirrors.");
- return 0;
+ goto try_new_takeover_or_reshape;
}
/* Change number of RAID1 images */
@@ -1965,6 +1965,11 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
log_error("Conversion operation not yet supported.");
+try_new_takeover_or_reshape:
+ ;
+
+ /* FIXME New takeover and reshape code is called from here */
+
return 0;
}
7 years, 9 months