if (!storeRebuildLoadEntry(fd, sd->index, buf, counts))
return;
+ const uint64_t expectedSize = sb.st_size > 0 ?
+ static_cast<uint64_t>(sb.st_size) : 0;
+
StoreEntry tmpe;
- const bool loaded = storeRebuildParseEntry(buf, tmpe, key, counts,
- (int64_t)sb.st_size);
+ const bool parsed = storeRebuildParseEntry(buf, tmpe, key, counts,
+ expectedSize);
file_close(fd);
--store_open_disk_fd;
fd = -1;
- if (!loaded) {
+ bool accepted = parsed && tmpe.swap_file_sz > 0;
+ if (parsed && !accepted) {
+ debugs(47, DBG_IMPORTANT, "WARNING: Ignoring ufs cache entry with " <<
+ "unknown size: " << tmpe);
+ accepted = false;
+ }
+
+ if (!accepted) {
// XXX: shouldn't this be a call to commonUfsUnlink?
sd->unlinkFile(filn); // should we unlink in all failure cases?
return;
static int store_errors = 0;
static StoreSearchPointer currentSearch;
static int validated = 0;
+ static int seen = 0;
if (currentSearch == NULL || currentSearch->isDone())
currentSearch = Store::Root().search(NULL, NULL);
e = currentSearch->currentItem();
+ ++seen;
+
if (EBIT_TEST(e->flags, ENTRY_VALIDATED))
continue;
}
if (currentSearch->isDone()) {
+ debugs(20, 2, "Seen: " << seen << " entries");
debugs(20, DBG_IMPORTANT, " Completed Validation Procedure");
debugs(20, DBG_IMPORTANT, " Validated " << validated << " Entries");
debugs(20, DBG_IMPORTANT, " store_swap_size = " << Store::Root().currentSize() / 1024.0 << " KB");
return false;
}
} else if (tmpe.swap_file_sz <= 0) {
- debugs(47, DBG_IMPORTANT, "WARNING: Ignoring cache entry with " <<
- "unknown size: " << tmpe);
- return false;
+ // if caller cannot handle unknown sizes, it must check after the call.
+ debugs(47, 7, "unknown size: " << tmpe);
}
if (EBIT_TEST(tmpe.flags, KEY_PRIVATE)) {