From 59a5361fc4b4a404229acce72156be444e75fced Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Sat, 3 Mar 2012 17:12:21 +0000 Subject: Obtain VG list from lvmetad before relying on get_vgs, otherwise PVs in VGs don't appear. --- tools/pvscan.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/pvscan.c b/tools/pvscan.c index cca079c8..c91d5912 100644 --- a/tools/pvscan.c +++ b/tools/pvscan.c @@ -165,6 +165,10 @@ int pvscan(struct cmd_context *cmd, int argc, char **argv) persistent_filter_wipe(cmd->filter); lvmcache_destroy(cmd, 1); + /* populate lvmcache */ + if (!lvmetad_vg_list_to_lvmcache(cmd)) + stack; + log_verbose("Walking through all physical volumes"); if (!(pvslist = get_pvs(cmd))) { unlock_vg(cmd, VG_GLOBAL); @@ -177,8 +181,8 @@ int pvscan(struct cmd_context *cmd, int argc, char **argv) pv = pvl->pv; if ((arg_count(cmd, exported_ARG) - && !(pv_status(pv) & EXPORTED_VG)) - || (arg_count(cmd, novolumegroup_ARG) && (!is_orphan(pv)))) { + && !(pv_status(pv) & EXPORTED_VG)) || + (arg_count(cmd, novolumegroup_ARG) && (!is_orphan(pv)))) { dm_list_del(&pvl->list); continue; } -- cgit