From d09a7dfc6ed660f81201e3ea28202d81b1b7dbb3 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Thu, 9 Jul 2009 11:29:41 +0000 Subject: [PATCH] Fix and precise metadata read errors for segment areas. --- WHATS_NEW | 1 + lib/format_text/import_vsn1.c | 15 ++++++--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 8facd0851..440365335 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.49 - ================================ + Fix and precise metadata read errors for segment areas. Fix segment metadata read function errors to use proper segment name. Add parent node to config_node structure. Fix segment import functions to print segment name and logical volume name. diff --git a/lib/format_text/import_vsn1.c b/lib/format_text/import_vsn1.c index db64fcbbc..629310a07 100644 --- a/lib/format_text/import_vsn1.c +++ b/lib/format_text/import_vsn1.c @@ -377,32 +377,29 @@ int text_import_areas(struct lv_segment *seg, const struct config_node *sn, unsigned int s; struct config_value *cv; struct logical_volume *lv1; - const char *seg_name = sn->key; + struct physical_volume *pv; + const char *seg_name = config_parent_name(sn); if (!seg->area_count) { - log_error("Zero areas not allowed for segment '%s'", sn->key); + log_error("Zero areas not allowed for segment %s", seg_name); return 0; } for (cv = cn->v, s = 0; cv && s < seg->area_count; s++, cv = cv->next) { /* first we read the pv */ - const char *bad = "Badly formed areas array for " - "segment '%s'."; - struct physical_volume *pv; - if (cv->type != CFG_STRING) { - log_error(bad, sn->key); + log_error("Bad volume name in areas array for segment %s.", seg_name); return 0; } if (!cv->next) { - log_error(bad, sn->key); + log_error("Missing offset in areas array for segment %s.", seg_name); return 0; } if (cv->next->type != CFG_INT) { - log_error(bad, sn->key); + log_error("Bad offset in areas array for segment %s.", seg_name); return 0; } -- 2.43.5