From: Alex Rousskov Date: Mon, 11 Apr 2011 23:50:50 +0000 (-0600) Subject: Avoid creating unlocked store_table entries when handling rebuild conflicts. X-Git-Tag: take06~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a46219b7fa11f62c7ef53525d7a46f608d187c12;p=thirdparty%2Fsquid.git Avoid creating unlocked store_table entries when handling rebuild conflicts. Such StoreEntry objects persist until a hit locks and unlocks them (or the replacement policy removes them?), creating SMP synchronization problems because they are treated as in-transit objects even though their store slot may be gone already. --- diff --git a/src/store_rebuild.cc b/src/store_rebuild.cc index 26045beecf..0ae8ef1780 100644 --- a/src/store_rebuild.cc +++ b/src/store_rebuild.cc @@ -400,6 +400,12 @@ storeRebuildKeepEntry(const StoreEntry &tmpe, const cache_key *key, /* key already exists, old entry is newer */ /* keep old, ignore new */ counts.dupcount++; + + // For some stores, get() creates/unpacks a store entry. Signal + // such stores that we will no longer use the get() result: + e->lock(); + e->unlock(); + return false; } else { /* URL already exists, this swapfile not being used */