]> sourceware.org Git - lvm2.git/commitdiff
Currently if clvmd is running and user issues vgscan,
authorMilan Broz <mbroz@redhat.com>
Thu, 13 May 2010 13:04:03 +0000 (13:04 +0000)
committerMilan Broz <mbroz@redhat.com>
Thu, 13 May 2010 13:04:03 +0000 (13:04 +0000)
the device cache file is dumped both in vgscan and clvmd process.

Unfortunately, clvmd calls lvmcache_label_scan,
it properly destroys persistent filter, but during
persistent_filter_dump it merges old cache content back!

This causes that change in filters is not properly propagated
into device cache after vgscan on cluster.
(Only new devices are added.)

https://bugzilla.redhat.com/show_bug.cgi?id=591861

WHATS_NEW
lib/cache/lvmcache.c
lib/commands/toolcontext.c
lib/filters/filter-persistent.c
lib/filters/filter-persistent.h

index 4b485282fe4b3ec9c0db9e1871c94a1b9c90488d..f97bf9a7dd705c90ed86745f24b1e6c29bd46280 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.65 - 
 =================================
+  Do not merge old device cache after we run full scan. (2.02.56)
   Add pkgconfigdir Makefile variable for make install override.
   Switch usage of Libs.private: to Requires.private: in devmapper.pc, lvm2app.pc.
   Use field Requires.private: for devmapper-event.pc.
index 0e31a4eedced1884ab5ce58c33417e1f45f61de3..940c61f39cc45d0bfcf50c261b25ad320b5d6dd1 100644 (file)
@@ -567,7 +567,7 @@ int lvmcache_label_scan(struct cmd_context *cmd, int full_scan)
         * device cache for the benefit of short-lived processes.
         */
        if (full_scan == 2 && cmd->is_long_lived && cmd->dump_filter)
-               persistent_filter_dump(cmd->filter);
+               persistent_filter_dump(cmd->filter, 0);
 
        r = 1;
 
index 69c79e7c55f0476ed6953ba63fc6332639aa02fa..c780d2673758eac5ca8459cc1cec68ea6f93c149 100644 (file)
@@ -1341,7 +1341,7 @@ int refresh_toolcontext(struct cmd_context *cmd)
 void destroy_toolcontext(struct cmd_context *cmd)
 {
        if (cmd->dump_filter)
-               persistent_filter_dump(cmd->filter);
+               persistent_filter_dump(cmd->filter, 1);
 
        archive_exit(cmd);
        backup_exit(cmd);
index 9243a9443b20424c51575799c43eebceb28969c8..4cb0d7db365107b8fcf9cc279fd80da6f770e0f3 100644 (file)
@@ -168,7 +168,7 @@ static void _write_array(struct pfilter *pf, FILE *fp, const char *path,
                fprintf(fp, "\n\t]\n");
 }
 
-int persistent_filter_dump(struct dev_filter *f)
+int persistent_filter_dump(struct dev_filter *f, int merge_existing)
 {
        struct pfilter *pf;
        char *tmp_file;
@@ -220,7 +220,7 @@ int persistent_filter_dump(struct dev_filter *f)
        /*
         * If file contents changed since we loaded it, merge new contents
         */
-       if (info.st_ctime != pf->ctime)
+       if (merge_existing && info.st_ctime != pf->ctime)
                /* Keep cft open to avoid losing lock */
                persistent_filter_load(f, &cft);
 
index 4b0fc555735c93679026630ca177c163ed08aa81..a7f1245e0f56990770a31f9e367eeb63d25d16b1 100644 (file)
@@ -23,6 +23,6 @@ struct dev_filter *persistent_filter_create(struct dev_filter *f,
 
 int persistent_filter_wipe(struct dev_filter *f);
 int persistent_filter_load(struct dev_filter *f, struct config_tree **cft_out);
-int persistent_filter_dump(struct dev_filter *f);
+int persistent_filter_dump(struct dev_filter *f, int merge_existing);
 
 #endif
This page took 0.052278 seconds and 5 git commands to generate.