dev-mornfall-activate - config: merge timestamps
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=45eeb70b02df0f196ccd851c23c42fc29d6efb39 Commit: 45eeb70b02df0f196ccd851c23c42fc29d6efb39 Parent: 2925023411ff9c7a32fa7660617c94a9d9dcd653 Author: Zdenek Kabelac <[email protected]> AuthorDate: Tue Apr 23 12:24:17 2013 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Tue Apr 23 12:31:16 2013 +0200
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.
--- WHATS_NEW | 1 + lib/config/config.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 0 deletions(-)
WHATS_NEW +1 -0
@@ -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.
lib/config/config.c +11 -0
@@ -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 ; }