Skip to contentSkip to conversation

master - pvscan: Remove duplicate filter wipe.

PATCH Alasdair Kergon 1 participant 1 message Dec 14, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=37bd35bc3ddbd4b669c523e2f56aaa68682df2ad
Commit:        37bd35bc3ddbd4b669c523e2f56aaa68682df2ad
Parent:        92e14227074f70eb824a93023a7dbc7cafb0e4f3
Author:        Alasdair G Kergon <[email protected]>
AuthorDate:    Mon Dec 14 20:14:59 2015 +0000
Committer:     Alasdair G Kergon <[email protected]>
CommitterDate: Mon Dec 14 20:14:59 2015 +0000

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.

---
 tools/pvscan.c  |    4 ----
 tools/toollib.c |    5 ++++-
 2 files changed, 4 insertions(+), 5 deletions(-)
tools/pvscan.c +0 -4
index 460b74d..68a074e 100644
@@ -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.");
tools/toollib.c +4 -1
index fb6edad..0b9f505 100644
@@ -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