From: Alex Rousskov Date: Sun, 28 Jul 2013 01:13:57 +0000 (-0600) Subject: Removing a shared cache entry w/o slices does not count as successful purging X-Git-Tag: SQUID_3_5_0_1~444^2~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5bba33c94bf702f4b10b2d90304f5e5ce749ebbb;p=thirdparty%2Fsquid.git Removing a shared cache entry w/o slices does not count as successful purging because all callers need a new slice, not an available anchor position. --- diff --git a/src/ipc/StoreMap.cc b/src/ipc/StoreMap.cc index f27364ebce..2cd1e5c118 100644 --- a/src/ipc/StoreMap.cc +++ b/src/ipc/StoreMap.cc @@ -356,7 +356,8 @@ Ipc::StoreMap::purgeOne() assert(valid(fileno)); Anchor &s = shared->slots[fileno].anchor; if (s.lock.lockExclusive()) { - if (!s.empty()) { + // the caller wants a free slice; empty anchor is not enough + if (!s.empty() && s.start >= 0) { // this entry may be marked for deletion, and that is OK freeChain(fileno, s, false); debugs(54, 5, "purged entry " << fileno << " from " << path); diff --git a/src/ipc/StoreMap.h b/src/ipc/StoreMap.h index d441c858ae..97154e63a1 100644 --- a/src/ipc/StoreMap.h +++ b/src/ipc/StoreMap.h @@ -180,7 +180,7 @@ public: /// stop writing the entry, freeing its slot for others to use if possible void abortWriting(const sfileno fileno); - /// finds an unlocked entry and frees it or returns false + /// either finds and frees an entry with at least 1 slice or returns false bool purgeOne(); /// copies slice to its designated position