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

metadata: Add pvs_outdated to struct volume_group.

This is a list of PVs that should have their MDAs wiped because they carry
outdated metadata (that used to belong to the VG they are attached to).
This commit is contained in:
Petr Rockai 2015-04-15 16:41:09 +02:00
parent 5435346052
commit 611c8b6d29
3 changed files with 11 additions and 0 deletions

View File

@ -3307,6 +3307,9 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
*consistent = _repair_inconsistent_vg(correct_vg); *consistent = _repair_inconsistent_vg(correct_vg);
else else
*consistent = !reappeared; *consistent = !reappeared;
if (_wipe_outdated_pvs(cmd, correct_vg, &correct_vg->pvs_outdated))
/* clear the list */
dm_list_init(&correct_vg->pvs_outdated);
} }
return correct_vg; return correct_vg;
} }

View File

@ -61,6 +61,7 @@ struct volume_group *alloc_vg(const char *pool_name, struct cmd_context *cmd,
dm_list_init(&vg->pvs); dm_list_init(&vg->pvs);
dm_list_init(&vg->pvs_to_create); dm_list_init(&vg->pvs_to_create);
dm_list_init(&vg->pvs_outdated);
dm_list_init(&vg->lvs); dm_list_init(&vg->lvs);
dm_list_init(&vg->tags); dm_list_init(&vg->tags);
dm_list_init(&vg->removed_lvs); dm_list_init(&vg->removed_lvs);

View File

@ -90,6 +90,13 @@ struct volume_group {
struct dm_list pvs_to_create; struct dm_list pvs_to_create;
/*
* List of physical volumes that carry outdated metadata that belongs
* to this VG. Currently only populated when lvmetad is in use.
*/
struct dm_list pvs_outdated;
/* /*
* logical volumes * logical volumes
* The following relationship should always hold: * The following relationship should always hold: