1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

config: merge timestamps

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.
This commit is contained in:
Zdenek Kabelac 2013-04-23 12:24:17 +02:00
parent 2925023411
commit 45eeb70b02
2 changed files with 12 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.99 - Version 2.02.99 -
=================================== ===================================
Find newest timestamp of merged config files.
Fix assignment order for vg fid for lvm1 and pool format. Fix assignment order for vg fid for lvm1 and pool format.
Fix memleak in dmeventd thin plugin in device list obtaining err path. Fix memleak in dmeventd thin plugin in device list obtaining err path.
Add explicit message about unsupported pvmove for thin/thinpool volumes. Add explicit message about unsupported pvmove for thin/thinpool volumes.

View 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 *root = cft->root;
struct dm_config_node *cn, *nextn, *oldn, *cn2; struct dm_config_node *cn, *nextn, *oldn, *cn2;
const struct dm_config_node *tn; const struct dm_config_node *tn;
struct config_file *cf, *cfn;
for (cn = newdata->root; cn; cn = nextn) { for (cn = newdata->root; cn; cn = nextn) {
nextn = cn->sib; nextn = cn->sib;
@ -797,6 +798,16 @@ int merge_config_tree(struct cmd_context *cmd, struct dm_config_tree *cft,
_merge_section(oldn, cn); _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; return 1;
} }