--------------------- PatchSet 868 Date: 2000/11/25 22:58:02 Author: rbcollins Branch: store_check Tag: (none) Log: found a race between background check and swapout. Fixed. However a similar one may exist in storeCleanup. Members: src/store.c:1.5.4.1->1.5.4.2 src/store_rebuild.c:1.5.6.1->1.5.6.2 Index: squid/src/store.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store.c,v retrieving revision 1.5.4.1 retrieving revision 1.5.4.2 diff -u -r1.5.4.1 -r1.5.4.2 --- squid/src/store.c 25 Nov 2000 22:34:43 -0000 1.5.4.1 +++ squid/src/store.c 25 Nov 2000 22:58:02 -0000 1.5.4.2 @@ -1,6 +1,6 @@ /* - * $Id: store.c,v 1.5.4.1 2000/11/25 22:34:43 rbcollins Exp $ + * $Id: store.c,v 1.5.4.2 2000/11/25 22:58:02 rbcollins Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -800,6 +800,8 @@ hash_link *link_ptr = NULL; hash_link *link_next = NULL; validnum_start = validnum; + if (validnum==0) + debug(20,1) (" Beginning store background check at rate %d\n", Config.store_background_check_rate); while (validnum - validnum_start < Config.store_background_check_rate) { if (++bucketnum >= store_hash_buckets) { debug(20, 1) (" Completed Background Check Loop\n"); @@ -819,6 +821,8 @@ continue; if (e->swap_filen < 0) continue; + if (!(e->swap_status == SWAPOUT_DONE)) + continue; if (storeBackgroundCheckEntry(e)){ store_errors++; } Index: squid/src/store_rebuild.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store_rebuild.c,v retrieving revision 1.5.6.1 retrieving revision 1.5.6.2 diff -u -r1.5.6.1 -r1.5.6.2 --- squid/src/store_rebuild.c 25 Nov 2000 22:34:43 -0000 1.5.6.1 +++ squid/src/store_rebuild.c 25 Nov 2000 22:58:02 -0000 1.5.6.2 @@ -1,6 +1,6 @@ /* - * $Id: store_rebuild.c,v 1.5.6.1 2000/11/25 22:34:43 rbcollins Exp $ + * $Id: store_rebuild.c,v 1.5.6.2 2000/11/25 22:58:02 rbcollins Exp $ * * DEBUG: section 20 Store Rebuild Routines * AUTHOR: Duane Wessels @@ -126,8 +126,8 @@ counts.invalid += dc->invalid; counts.badflags += dc->badflags; counts.bad_log_op += dc->bad_log_op; - counts.missingcount += dc->missingcount; - counts.filesizemismatchcount += dc->filesizemismatchcount; +/* counts.missingcount += dc->missingcount; + counts.filesizemismatchcount += dc->filesizemismatchcount; */ counts.zero_object_sz += dc->zero_object_sz; /* * When store_dirs_rebuilding == 1, it means we are done reading @@ -146,7 +146,7 @@ debug(20, 1) (" %7d Objects cancelled.\n", counts.cancelcount); debug(20, 1) (" %7d Duplicate URLs purged.\n", counts.dupcount); debug(20, 1) (" %7d Swapfile clashes avoided.\n", counts.clashcount); - debug(20, 1) (" %7d Missing files ignored.\n", counts.missingcount); +/* debug(20, 1) (" %7d Missing files ignored.\n", counts.missingcount); */ debug(20, 1) (" %7d Incorrect length swapfiles %s.\n", counts.filesizemismatchcount, (opt_store_doublecheck == DBLCHECK_REPORTONLY) ? "ignored" : "unlinked");