]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
From Squid-2.5: Bugzilla #465: Instability if there is requests while
authorhno <>
Thu, 9 Jan 2003 18:49:35 +0000 (18:49 +0000)
committerhno <>
Thu, 9 Jan 2003 18:49:35 +0000 (18:49 +0000)
Squid rebuilds the cache index.

src/fs/coss/store_dir_coss.cc
src/ufscommon.cc

index 09b255c081b5d7dc9f3e730adde314626020d611..50b790bd6a56c26591cc5e9c1a137d6425ac965d 100644 (file)
@@ -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
index f64c5af1f0069630fdda5555d8b47c1f5f573a69..31b3d10239fbfe49bf3f82c1dc44104dd90ee6d2 100644 (file)
@@ -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