summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2015-12-14 20:14:59 +0000
committerAlasdair G Kergon <agk@redhat.com>2015-12-14 20:14:59 +0000
commit37bd35bc3ddbd4b669c523e2f56aaa68682df2ad (patch)
tree08aff23cc096f828c87ed2c2aea581a19e5ce120
parent92e14227074f70eb824a93023a7dbc7cafb0e4f3 (diff)
downloadlvm2-37bd35bc3ddbd4b669c523e2f56aaa68682df2ad.tar.gz
pvscan: Remove duplicate filter wipe.
Also always clear the internal lvmcache after rescanning, and reinstate a test for --trustcache so that 'pvs --trustcache' (for example) avoids rescanning.
-rw-r--r--tools/pvscan.c4
-rw-r--r--tools/toollib.c5
2 files changed, 4 insertions, 5 deletions
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 460b74d51..68a074e02 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -404,10 +404,6 @@ int pvscan(struct cmd_context *cmd, int argc, char **argv)
if (!lockd_gl(cmd, "sh", 0))
return_ECMD_FAILED;
- if (cmd->full_filter->wipe)
- cmd->full_filter->wipe(cmd->full_filter);
-
- lvmcache_destroy(cmd, 1, 0);
if (!(handle = init_processing_handle(cmd))) {
log_error("Failed to initialize processing handle.");
diff --git a/tools/toollib.c b/tools/toollib.c
index fb6edadde..0b9f5055a 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -3344,7 +3344,10 @@ int process_each_pv(struct cmd_context *cmd,
* it were not done here first. It's called here first
* so that get_vgnameids() will look at any new devices.
*/
- dev_cache_full_scan(cmd->full_filter);
+ if (!trust_cache()) {
+ dev_cache_full_scan(cmd->full_filter);
+ lvmcache_destroy(cmd, 1, 0);
+ }
/*
* Need pvid's set on all PVs before processing so that pvid's