Version 2.02.118 -
=================================
+ Measure configuration timestamps with nanoseconds when available.
Disable lvchange of major and minor of pool LVs.
Fix pvscan --cache to not scan and read ignored metadata areas on PVs.
Add After=iscsi-shutdown.service to blk-availability.service systemd unit.
struct dev_filter *filter = NULL, *filter_components[2] = {0};
struct stat st;
const struct dm_config_node *cn;
+ struct timespec ts, cts;
cmd->dump_filter = 0;
*/
if (!find_config_tree_bool(cmd, global_use_lvmetad_CFG, NULL) &&
load_persistent_cache && !cmd->is_long_lived &&
- !stat(dev_cache, &st) &&
- (st.st_ctime > config_file_timestamp(cmd->cft)) &&
- !persistent_filter_load(cmd->filter, NULL))
- log_verbose("Failed to load existing device cache from %s",
- dev_cache);
+ !stat(dev_cache, &st)) {
+ lvm_stat_ctim(&ts, &st);
+ cts = config_file_timestamp(cmd->cft);
+ if (timespeccmp(&ts, &cts, >) &&
+ !persistent_filter_load(cmd->filter, NULL))
+ log_verbose("Failed to load existing device cache from %s",
+ dev_cache);
+ }
return 1;
bad:
struct config_source {
config_source_t type;
- time_t timestamp;
+ struct timespec timestamp;
union {
struct config_file *file;
struct config_file *profile;
return 0;
}
- cs->timestamp = info->st_ctime;
+ lvm_stat_ctim(&cs->timestamp, info);
cf->exists = 1;
cf->st_size = info->st_size;
struct config_source *cs = dm_config_get_custom(cft);
struct config_file *cf;
struct stat info;
+ struct timespec ts;
if (cs->type != CONFIG_FILE) {
log_error(INTERNAL_ERROR "config_file_changed: expected file config source, "
}
/* Unchanged? */
- if (cs->timestamp == info.st_ctime && cf->st_size == info.st_size)
+ lvm_stat_ctim(&ts, &info);
+ if ((timespeccmp(&cs->timestamp, &ts, ==)) &&
+ cf->st_size == info.st_size)
return 0;
reload:
return r;
}
-time_t config_file_timestamp(struct dm_config_tree *cft)
+struct timespec config_file_timestamp(struct dm_config_tree *cft)
{
struct config_source *cs = dm_config_get_custom(cft);
return cs->timestamp;
cs = dm_config_get_custom(cft);
csn = dm_config_get_custom(newdata);
- if (cs && csn && (cs->timestamp < csn->timestamp))
+ if (cs && csn && timespeccmp(&cs->timestamp, &csn->timestamp, <))
cs->timestamp = csn->timestamp;
return 1;
struct dm_config_tree *config_def_create_tree(struct config_def_tree_spec *spec);
void config_destroy(struct dm_config_tree *cft);
-time_t config_file_timestamp(struct dm_config_tree *cft);
+struct timespec config_file_timestamp(struct dm_config_tree *cft);
int config_file_changed(struct dm_config_tree *cft);
int config_file_check(struct dm_config_tree *cft, const char **filename, struct stat *info);
char *file;
struct dm_hash_table *devices;
struct dev_filter *real;
- time_t ctime;
+ struct timespec ctime;
struct dev_types *dt;
};
}
if (!stat(pf->file, &info))
- pf->ctime = info.st_ctime;
+ lvm_stat_ctim(&pf->ctime, &info);
else {
log_very_verbose("%s: stat failed: %s", pf->file,
strerror(errno));
struct pfilter *pf;
char *tmp_file;
struct stat info, info2;
+ struct timespec ts;
struct dm_config_tree *cft = NULL;
FILE *fp;
int lockfd;
/*
* If file contents changed since we loaded it, merge new contents
*/
- if (merge_existing && info.st_ctime != pf->ctime)
+ lvm_stat_ctim(&ts, &info);
+ if (merge_existing && timespeccmp(&ts, &pf->ctime, !=))
/* Keep cft open to avoid losing lock */
persistent_filter_load(f, &cft);
/* Only merge cache file before dumping it if it changed externally. */
if (!stat(pf->file, &info))
- pf->ctime = info.st_ctime;
+ lvm_stat_ctim(&pf->ctime, &info);
f->passes_filter = _lookup_p;
f->destroy = _persistent_destroy;