1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

validation: move check for spare correctness

Check lv feature when we check LVs
This commit is contained in:
Zdenek Kabelac 2014-09-21 11:34:50 +02:00
parent 93fbef1a45
commit 9f82a7d114

View File

@ -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);