summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2012-03-03 17:12:21 +0000
committerAlasdair Kergon <agk@redhat.com>2012-03-03 17:12:21 +0000
commit59a5361fc4b4a404229acce72156be444e75fced (patch)
treee01c4b817bdfbc8d3cd7d0d969176262b1d39b11
parent113f2a01132ca7d35a1edfd3bb3a24fd61d06dbb (diff)
downloadlvm2-59a5361fc4b4a404229acce72156be444e75fced.tar.gz
lvm2-59a5361fc4b4a404229acce72156be444e75fced.tar.xz
lvm2-59a5361fc4b4a404229acce72156be444e75fced.zip
Obtain VG list from lvmetad before relying on get_vgs, otherwise PVs in VGs
don't appear.
-rw-r--r--tools/pvscan.c8
1 files 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;
}