diff --git a/WHATS_NEW b/WHATS_NEW index 887fafdde..9ff1ce248 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.130 - =================================== + Fix use of uninitialized device status if reading outdated .cache record. Restore support for --monitor option in lvcreate (2.02.112). Read thin-pool data and metadata percent without flush. Detect blocked thin-pool and avoid scanning their thin volumes. diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c index 4ed0130ff..b9d427190 100644 --- a/lib/device/dev-cache.c +++ b/lib/device/dev-cache.c @@ -948,6 +948,7 @@ struct device *dev_cache_get(const char *name, struct dev_filter *f) { struct stat buf; struct device *d = (struct device *) dm_hash_lookup(_cache.names, name); + int info_available = 0; if (d && (d->flags & DEV_REGULAR)) return d; @@ -958,7 +959,8 @@ struct device *dev_cache_get(const char *name, struct dev_filter *f) dm_hash_remove(_cache.names, name); log_sys_very_verbose("stat", name); d = NULL; - } + } else + info_available = 1; if (d && (buf.st_rdev != d->dev)) { dm_hash_remove(_cache.names, name); @@ -966,7 +968,7 @@ struct device *dev_cache_get(const char *name, struct dev_filter *f) } if (!d) { - _insert(name, &buf, 0, obtain_device_list_from_udev()); + _insert(name, info_available ? &buf : NULL, 0, obtain_device_list_from_udev()); d = (struct device *) dm_hash_lookup(_cache.names, name); if (!d) { _full_scan(0);