|
@@ -539,9 +539,16 @@ consensus_cache_rescan(consensus_cache_t *cache)
|
|
|
map = storage_dir_map_labeled(cache->dir, fname,
|
|
|
&labels, &body, &bodylen);
|
|
|
if (! map) {
|
|
|
-
|
|
|
- log_warn(LD_FS, "Unable to map file %s from consensus cache: %s",
|
|
|
- escaped(fname), strerror(errno));
|
|
|
+ if (errno == ERANGE || errno == EINVAL) {
|
|
|
+ log_warn(LD_FS, "Found %s file %s in consensus cache; removing it.",
|
|
|
+ errno == ERANGE ? "empty" : "misformatted",
|
|
|
+ escaped(fname));
|
|
|
+ storage_dir_remove_file(cache->dir, fname);
|
|
|
+ } else {
|
|
|
+
|
|
|
+ log_warn(LD_FS, "Unable to map file %s from consensus cache: %s",
|
|
|
+ escaped(fname), strerror(errno));
|
|
|
+ }
|
|
|
continue;
|
|
|
}
|
|
|
consensus_cache_entry_t *ent =
|