summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2019-02-06 13:00:33 -0600
committerDavid Teigland <teigland@redhat.com>2019-05-21 15:42:15 -0500
commit36659c8dbc838419cb4747a3af6e53a4506c0498 (patch)
tree7f5332aedba47501eab0a316c464dbcb49020855
parentb886940c4954fb93fddb6767dfb85c37fb643c91 (diff)
downloadlvm2-36659c8dbc838419cb4747a3af6e53a4506c0498.tar.gz
process_each_pv handle outdated pvs
process_each_pv should account for outdated pvs in the list of all devices it is processing.
-rw-r--r--tools/toollib.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/toollib.c b/tools/toollib.c
index 8e882e926..78b174553 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -4156,12 +4156,16 @@ static int _process_pvs_in_vg(struct cmd_context *cmd,
struct physical_volume *pv;
struct pv_list *pvl;
struct device_id_list *dil;
+ struct device_list *devl;
+ struct dm_list outdated_devs;
const char *pv_name;
int process_pv;
int do_report_ret_code = 1;
int ret_max = ECMD_PROCESSED;
int ret = 0;
+ dm_list_init(&outdated_devs);
+
log_set_report_object_type(LOG_REPORT_OBJECT_TYPE_PV);
vg_uuid[0] = '\0';
@@ -4247,6 +4251,12 @@ static int _process_pvs_in_vg(struct cmd_context *cmd,
break;
log_set_report_object_name_and_id(NULL, NULL);
}
+
+ if (!is_orphan_vg(vg->name))
+ lvmcache_get_outdated_devs(cmd, vg->name, (const char *)&vg->id, &outdated_devs);
+ dm_list_iterate_items(devl, &outdated_devs)
+ _device_list_remove(all_devices, devl->dev);
+
do_report_ret_code = 0;
out:
if (do_report_ret_code)