From 9f82a7d11469400fcf5ca01b4444b3ba25ba06b8 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sun, 21 Sep 2014 11:34:50 +0200 Subject: [PATCH] validation: move check for spare correctness Check lv feature when we check LVs --- lib/metadata/metadata.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index 464b8bc5d..354dc68f6 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -2492,6 +2492,19 @@ int vg_validate(struct volume_group *vg) r = 0; } + if (lv_is_pool_metadata_spare(lvl->lv)) { + if (++spare_count > 1) { + log_error(INTERNAL_ERROR "LV %s is %u. pool metadata spare (>1).", + lvl->lv->name, spare_count); + r = 0; + } + if (vg->pool_metadata_spare_lv != lvl->lv) { + log_error(INTERNAL_ERROR "LV %s is not vg pool metadata spare.", + lvl->lv->name); + r = 0; + } + } + if (lv_is_cow(lvl->lv)) num_snapshots++; @@ -2590,19 +2603,6 @@ int vg_validate(struct volume_group *vg) r = 0; } - if (lv_is_pool_metadata_spare(lvl->lv)) { - if (++spare_count > 1) { - log_error(INTERNAL_ERROR "LV %s is %u. pool metadata spare (>1).", - lvl->lv->name, spare_count); - r = 0; - } - if (vg->pool_metadata_spare_lv != lvl->lv) { - log_error(INTERNAL_ERROR "LV %s is not vg pool metadata spare.", - lvl->lv->name); - r = 0; - } - } - if (!check_lv_segments(lvl->lv, 1)) { log_error(INTERNAL_ERROR "LV segments corrupted in %s.", lvl->lv->name);