]> sourceware.org Git - lvm2.git/commitdiff
config: merge timestamps
authorZdenek Kabelac <zkabelac@redhat.com>
Tue, 23 Apr 2013 10:24:17 +0000 (12:24 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Tue, 23 Apr 2013 10:31:16 +0000 (12:31 +0200)
Merging multiple config files together needs to know newest (highest)
timestamp of merged files. Persistent cache file is being used
only in case, the config file is older then .cache file.

WHATS_NEW
lib/config/config.c

index c1324de2cece49c1fd7089fcad6e3a22fec704cd..4139557b13ab23f67f8d774abff02ca35c8b6392 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.99 - 
 ===================================
+  Find newest timestamp of merged config files.
   Fix assignment order for vg fid for lvm1 and pool format.
   Fix memleak in dmeventd thin plugin in device list obtaining err path.
   Add explicit message about unsupported pvmove for thin/thinpool volumes.
index e999fc697c5501b6f0495ffc21b6790c85ffe008..0af57d548b405244f1b39f8a5753d0251aace50b 100644 (file)
@@ -768,6 +768,7 @@ int merge_config_tree(struct cmd_context *cmd, struct dm_config_tree *cft,
        struct dm_config_node *root = cft->root;
        struct dm_config_node *cn, *nextn, *oldn, *cn2;
        const struct dm_config_node *tn;
+       struct config_file *cf, *cfn;
 
        for (cn = newdata->root; cn; cn = nextn) {
                nextn = cn->sib;
@@ -797,6 +798,16 @@ int merge_config_tree(struct cmd_context *cmd, struct dm_config_tree *cft,
                _merge_section(oldn, cn);
        }
 
+       /*
+        * Persistent filter loading is based on timestamp,
+        * so we need to know the newest timestamp to make right decision
+        * whether the .cache isn't older then any of configs
+        */
+       if ((cf = dm_config_get_custom(cft)) &&
+           (cfn = dm_config_get_custom(newdata)) &&
+           cf->timestamp < cfn->timestamp)
+               cf->timestamp = cfn->timestamp;
+
        return 1;
 }
 
This page took 0.040957 seconds and 5 git commands to generate.