]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bugfix: The aufs corruption patch triggered another bug in accounting
authorhno <>
Fri, 15 Nov 2002 20:16:31 +0000 (20:16 +0000)
committerhno <>
Fri, 15 Nov 2002 20:16:31 +0000 (20:16 +0000)
of opening filedescriptors.

src/fs/aufs/async_io.cc
src/fs/aufs/store_io_aufs.cc

index bd725b90b077ee4b8bc0a99984d1c127874a02d7..fe8d3854b86883aa654c928654f0139c46aedad5 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: async_io.cc,v 1.18 2002/11/10 03:40:34 hno Exp $
+ * $Id: async_io.cc,v 1.19 2002/11/15 13:16:31 hno Exp $
  *
  * DEBUG: section 32    Asynchronous Disk I/O
  * AUTHOR: Pete Bentley <pete@demon.net>
@@ -171,7 +171,7 @@ aioCancel(int fd)
            AIOCB *callback = ctrlp->done_handler;
            void *cbdata;
            ctrlp->done_handler = NULL;
-           debug(32, 2) ("this be aioCancel\n");
+           debug(32, 1) ("this be aioCancel. Danger ahead!\n");
            if (cbdataReferenceValidDone(ctrlp->done_handler_data, &cbdata))
                callback(fd, cbdata, NULL, -2, -2);
            /* free data if requested to aioWrite() */
index 8a7beb66bb8c54b56133a75ca672d097780bde29..7ceebdebd18914f9d9a2bbdfc5dfbad484372596 100644 (file)
@@ -414,6 +414,8 @@ storeAufsIOCallback(storeIOState * sio, int errflag)
     debug(79, 9) ("%s:%d\n", __FILE__, __LINE__);
     aiostate->fd = -1;
     cbdataFree(sio);
+    if (aiostate->flags.opening)
+       Opening_FD--;
     if (fd < 0)
        return;
     debug(79, 9) ("%s:%d\n", __FILE__, __LINE__);
@@ -433,10 +435,11 @@ storeAufsNeedCompletetion(storeIOState * sio)
        return 1;
     if (aiostate->flags.opening && FILE_MODE(sio->mode) == O_WRONLY)
        return 1;
+    if (aiostate->flags.reading)
+       return 1;
     if (aiostate->flags.inreaddone)
        return 1;
 
-    /* Note: Pending read operations are silently cancelled on close */
     return 0;
 }