From: Alex Rousskov Date: Sat, 27 Jul 2013 17:19:29 +0000 (-0600) Subject: Keep anchor.basics.swap_file_sz in sync with slice sizes. X-Git-Tag: SQUID_3_5_0_1~444^2~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=76ba3c8a5ac5e04aa6acbedc7c314575ecffb440;p=thirdparty%2Fsquid.git Keep anchor.basics.swap_file_sz in sync with slice sizes. The old code updated anchor.basics.swap_file_sz _after_ copying all of the available data into shared memory. An exception in the copying loop (e.g., the map is out of available slots) could prevent that update. For another worker, the entry would then appear to be fully completed (no writer, last slice size stable, and last slice poiner is -1) and that worker would assert due to anchor.basics.swap_file_sz mismatching the sum of slice sizes. --- diff --git a/src/MemStore.cc b/src/MemStore.cc index 1cdf3a100d..116ba0651a 100644 --- a/src/MemStore.cc +++ b/src/MemStore.cc @@ -534,7 +534,6 @@ MemStore::copyToShm(StoreEntry &e) copyToShmSlice(e, anchor); } - anchor.basics.swap_file_sz = e.mem_obj->memCache.offset; debugs(20, 7, "mem-cached available " << eSize << " bytes of " << e); } @@ -569,6 +568,7 @@ MemStore::copyToShmSlice(StoreEntry &e, Ipc::StoreMapAnchor &anchor) slice.size += copied; e.mem_obj->memCache.offset += copied; + anchor.basics.swap_file_sz = e.mem_obj->memCache.offset; } /// finds a slot and a free page to fill or throws