Hi!

Here are three changes for squid2 HEAD cvs.

1. initialize mem_obj (uninitialized can cause seg. fault).
2. use THREAD_FACTOR instead of hard coded constant 16.
3. call squidaio_sync in aufs dir maintenance to limit queue growth
   (e.g. when repository size or high/low are decreased).

-- 
   Alexander.
Index: client_side.c
===================================================================
RCS file: /squid/squid/src/client_side.c,v
retrieving revision 1.742
diff -u -p -r1.742 client_side.c
--- client_side.c       25 Sep 2007 03:50:20 -0000      1.742
+++ client_side.c       8 Oct 2007 08:47:57 -0000
@@ -718,7 +718,7 @@ clientHandleETagReply(void *data, HttpRe
 {
     clientHttpRequest *http = data;
     StoreEntry *entry = http->entry;
-    MemObject *mem;
+    MemObject *mem = entry->mem_obj;
     const char *url = storeUrl(entry);
     http_status status;
     if (entry == NULL) {
Index: fs/aufs/aiops.c
===================================================================
RCS file: /squid/squid/src/fs/aufs/aiops.c,v
retrieving revision 1.31
diff -u -p -r1.31 aiops.c
--- fs/aufs/aiops.c     23 Sep 2006 10:16:40 -0000      1.31
+++ fs/aufs/aiops.c     8 Oct 2007 08:47:57 -0000
@@ -322,7 +322,7 @@ squidaio_init(void)
     /* Create threads and get them to sit in their wait loop */
     squidaio_thread_pool = memPoolCreate("aio_thread", 
sizeof(squidaio_thread_t));
     if (squidaio_nthreads == 0) {
-       int j = 16;
+       int j = THREAD_FACTOR;
        for (i = 0; i < n_asyncufs_dirs; i++) {
            squidaio_nthreads += j;
            j = j * 2 / 3;
@@ -338,7 +338,7 @@ squidaio_init(void)
 #endif
     }
     if (squidaio_nthreads == 0)
-       squidaio_nthreads = 16;
+       squidaio_nthreads = THREAD_FACTOR;
     squidaio_magic1 = squidaio_nthreads * MAGIC1_FACTOR;
     squidaio_magic2 = squidaio_nthreads * MAGIC2_FACTOR;
     for (i = 0; i < squidaio_nthreads; i++) {
Index: fs/aufs/store_dir_aufs.c
===================================================================
RCS file: /squid/squid/src/fs/aufs/store_dir_aufs.c,v
retrieving revision 1.69
diff -u -p -r1.69 store_dir_aufs.c
--- fs/aufs/store_dir_aufs.c    1 Mar 2007 07:21:37 -0000       1.69
+++ fs/aufs/store_dir_aufs.c    8 Oct 2007 08:47:57 -0000
@@ -1555,6 +1555,9 @@ storeAufsDirMaintain(SwapDir * SD)
     walker->Done(walker);
     debug(47, (removed ? 2 : 3)) ("storeAufsDirMaintain: %s removed %d/%d 
f=%.03f max_scan=%d\n",
        SD->path, removed, max_remove, f, max_scan);
+
+    if (squidaio_get_queue_len() > MAGIC1 - max_remove*2)
+       squidaio_sync(); /* prevent unlimited queue growth */
 }
 
 /*

Reply via email to