--------------------- PatchSet 6498 Date: 2005/03/11 20:35:12 Author: hno Branch: lfs-2_5 Tag: (none) Log: Protect ourselves from a race window while closing the swapout while still fetching the object. Members: src/store_swapout.c:1.11.2.1.30.4->1.11.2.1.30.5 Index: squid/src/store_swapout.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store_swapout.c,v retrieving revision 1.11.2.1.30.4 retrieving revision 1.11.2.1.30.5 diff -u -r1.11.2.1.30.4 -r1.11.2.1.30.5 --- squid/src/store_swapout.c 11 Mar 2005 14:10:18 -0000 1.11.2.1.30.4 +++ squid/src/store_swapout.c 11 Mar 2005 20:35:12 -0000 1.11.2.1.30.5 @@ -1,6 +1,6 @@ /* - * $Id: store_swapout.c,v 1.11.2.1.30.4 2005/03/11 14:10:18 hno Exp $ + * $Id: store_swapout.c,v 1.11.2.1.30.5 2005/03/11 20:35:12 hno Exp $ * * DEBUG: section 20 Storage Manager Swapout Functions * AUTHOR: Duane Wessels @@ -209,8 +209,6 @@ return; if (e->swap_status == SWAPOUT_WRITING) assert(mem->inmem_lo <= on_disk); - if (!storeSwapOutAble(e)) - return; debug(20, 7) ("storeSwapOut: swapout_size = %d\n", (int) swapout_size); if (swapout_size == 0) { @@ -298,12 +296,14 @@ storeSwapOutFileClose(StoreEntry * e) { MemObject *mem = e->mem_obj; + storeIOState *sio = mem->swapout.sio; assert(mem != NULL); debug(20, 3) ("storeSwapOutFileClose: %s\n", storeKeyText(e->hash.key)); debug(20, 3) ("storeSwapOutFileClose: sio = %p\n", mem->swapout.sio); - if (mem->swapout.sio == NULL) + if (sio == NULL) return; - storeClose(mem->swapout.sio); + mem->swapout.sio = NULL; + storeClose(sio); } static void