Search squid archive

Re: [squid-users] Squid 2.5stable9-20050402 always restart (stmem.c error)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 3 Apr 2005, Henrik Nordstrom wrote:

Please file a bug report with this info.

Bug report no longer needed. I have reproduced and identified the problem and it is an direct effect of the 2GB patch.


Currently testing a small patch [attached] which rips out a bit of obsolete code no longer needed after the patch and which was causing the problem.

 store_swapout.c |   43 ++-----------------------------------------
 1 files changed, 2 insertions(+), 41 deletions(-)

Regards
Henrik
? ChangeLog.cvs
? src/.enums.h.swp
Index: src/store_swapout.c
===================================================================
RCS file: /server/cvs-server/squid/squid/src/store_swapout.c,v
retrieving revision 1.85.2.6
diff -u -p -r1.85.2.6 store_swapout.c
--- src/store_swapout.c	27 Mar 2005 02:42:51 -0000	1.85.2.6
+++ src/store_swapout.c	3 Apr 2005 22:14:00 -0000
@@ -35,7 +35,6 @@
 
 #include "squid.h"
 
-static squid_off_t storeSwapOutObjectBytesOnDisk(const MemObject *);
 static void storeSwapOutStart(StoreEntry * e);
 static STIOCB storeSwapOutFileClosed;
 static STIOCB storeSwapOutFileNotify;
@@ -135,22 +134,10 @@ storeSwapOutMaintainMemObject(StoreEntry
 	new_mem_lo = lowest_offset;
     else
 	new_mem_lo = mem->inmem_lo;
+    if (swapout_able && mem->swapout.queue_offset < new_mem_lo)
+	new_mem_lo = mem->swapout.queue_offset;
     if (new_mem_lo < mem->inmem_lo)
 	new_mem_lo = mem->inmem_lo;
-    if (swapout_able && e->swap_status != SWAPOUT_DONE) {
-	/*
-	 * We should only free up to what we know has been written
-	 * to disk, not what has been queued for writing.  Otherwise
-	 * there will be a chunk of the data which is not in memory
-	 * and is not yet on disk.
-	 * The -1 makes sure the page isn't freed until storeSwapOut has
-	 * walked to the next page. (mem->swapout.memnode)
-	 */
-	if ((on_disk = storeSwapOutObjectBytesOnDisk(mem)) - 1 < new_mem_lo)
-	    new_mem_lo = on_disk - 1;
-	if (new_mem_lo == -1)
-	    new_mem_lo = 0;	/* the above might become -1 */
-    }
     if (mem->inmem_lo != new_mem_lo)
 	mem->inmem_lo = stmemFreeDataUpto(&mem->data_hdr, new_mem_lo);
 
@@ -359,32 +346,6 @@ storeSwapOutFileClosed(void *data, int e
 }
 
 /*
- * How much of the object data is on the disk?
- */
-static squid_off_t
-storeSwapOutObjectBytesOnDisk(const MemObject * mem)
-{
-    /*
-     * NOTE: storeOffset() represents the disk file size,
-     * not the amount of object data on disk.
-     * 
-     * If we don't have at least 'swap_hdr_sz' bytes
-     * then none of the object data is on disk.
-     *
-     * This should still be safe if swap_hdr_sz == 0,
-     * meaning we haven't even opened the swapout file
-     * yet.
-     */
-    squid_off_t nwritten;
-    if (mem->swapout.sio == NULL)
-	return 0;
-    nwritten = storeOffset(mem->swapout.sio);
-    if (nwritten <= mem->swap_hdr_sz)
-	return 0;
-    return nwritten - mem->swap_hdr_sz;
-}
-
-/*
  * Is this entry a candidate for writing to disk?
  */
 static int

[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux