From: hno <> Date: Thu, 9 Jan 2003 18:49:35 +0000 (+0000) Subject: From Squid-2.5: Bugzilla #465: Instability if there is requests while X-Git-Tag: SQUID_3_0_PRE1~468 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0aa2c37c60172e0559471751dfd3ac0c17230f15;p=thirdparty%2Fsquid.git From Squid-2.5: Bugzilla #465: Instability if there is requests while Squid rebuilds the cache index. --- diff --git a/src/fs/coss/store_dir_coss.cc b/src/fs/coss/store_dir_coss.cc index 09b255c081..50b790bd6a 100644 --- a/src/fs/coss/store_dir_coss.cc +++ b/src/fs/coss/store_dir_coss.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_coss.cc,v 1.41 2002/12/27 10:26:36 robertc Exp $ + * $Id: store_dir_coss.cc,v 1.42 2003/01/09 11:49:53 hno Exp $ * * DEBUG: section 47 Store COSS Directory Routines * AUTHOR: Eric Stern @@ -211,7 +211,8 @@ storeCossRebuildFromSwapLog(void *data) if (s.op == SWAP_LOG_ADD) { (void) 0; } else if (s.op == SWAP_LOG_DEL) { - if ((e = storeGet(s.key)) != NULL) { + /* Delete unless we already have a newer copy */ + if ((e = storeGet(s.key)) != NULL && s.lastref > e->lastref) { /* * Make sure we don't unlink the file, it might be * in use by a subsequent entry. Also note that diff --git a/src/ufscommon.cc b/src/ufscommon.cc index f64c5af1f0..31b3d10239 100644 --- a/src/ufscommon.cc +++ b/src/ufscommon.cc @@ -1,5 +1,5 @@ /* - * $Id: ufscommon.cc,v 1.5 2002/12/27 10:26:34 robertc Exp $ + * $Id: ufscommon.cc,v 1.6 2003/01/09 11:49:35 hno Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -259,7 +259,8 @@ RebuildState::rebuildFromSwapLog() if (s.op == SWAP_LOG_ADD) { (void) 0; } else if (s.op == SWAP_LOG_DEL) { - if ((e = storeGet(s.key)) != NULL) { + /* Delete unless we already have a newer copy */ + if ((e = storeGet(s.key)) != NULL && s.lastref > e->lastref) { /* * Make sure we don't unlink the file, it might be * in use by a subsequent entry. Also note that