diff options
author | Petr Rockai <prockai@redhat.com> | 2015-04-15 16:41:09 +0200 |
---|---|---|
committer | Petr Rockai <prockai@redhat.com> | 2015-05-20 19:46:14 +0200 |
commit | 611c8b6d29ca164a22270cb9b3dcf7958063c712 (patch) | |
tree | d241e6c1ab43564ca4a4c3949af76f38fc2e3477 | |
parent | 5435346052f491333b79da48bec5ef160cd118d5 (diff) | |
download | lvm2-611c8b6d29ca164a22270cb9b3dcf7958063c712.tar.gz |
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).
-rw-r--r-- | lib/metadata/metadata.c | 3 | ||||
-rw-r--r-- | lib/metadata/vg.c | 1 | ||||
-rw-r--r-- | lib/metadata/vg.h | 7 |
3 files changed, 11 insertions, 0 deletions
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index 5456c4ee4..8300eb6f2 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -3307,6 +3307,9 @@ static struct volume_group *_vg_read(struct cmd_context *cmd, *consistent = _repair_inconsistent_vg(correct_vg); else *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; } diff --git a/lib/metadata/vg.c b/lib/metadata/vg.c index c9a7e9e1b..1db8e7588 100644 --- a/lib/metadata/vg.c +++ b/lib/metadata/vg.c @@ -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_to_create); + dm_list_init(&vg->pvs_outdated); dm_list_init(&vg->lvs); dm_list_init(&vg->tags); dm_list_init(&vg->removed_lvs); diff --git a/lib/metadata/vg.h b/lib/metadata/vg.h index b0ab12217..bb21f3441 100644 --- a/lib/metadata/vg.h +++ b/lib/metadata/vg.h @@ -91,6 +91,13 @@ struct volume_group { 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 * The following relationship should always hold: * dm_list_size(lvs) = user visible lv_count + snapshot_count + other invisible LVs |