]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
A fix for the !flags.write_draining assertion. Due to the way diskd
authorwessels <>
Fri, 13 Apr 2007 02:36:56 +0000 (02:36 +0000)
committerwessels <>
Fri, 13 Apr 2007 02:36:56 +0000 (02:36 +0000)
works, drainWriteQueue() could get called twice in the stack.  If so,
just return when the write_draining flag is set.

src/fs/ufs/store_io_ufs.cc

index d2cb7fd2be37abe9d21974d26775a43a9d7dae9b..7966c40907a3fd788ec90172e16c2865acd5af2e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_io_ufs.cc,v 1.35 2007/04/12 18:05:21 wessels Exp $
+ * $Id: store_io_ufs.cc,v 1.36 2007/04/12 20:36:56 wessels Exp $
  *
  * DEBUG: section 79    Storage Manager UFS Interface
  * AUTHOR: Duane Wessels
@@ -474,7 +474,17 @@ UFSStoreState::queueRead(char *buf, size_t size, off_t offset, STRCB *callback,
 void
 UFSStoreState::drainWriteQueue()
 {
-    assert(!flags.write_draining);
+    /*
+     * DPW 2007-04-12
+     * We might find that flags.write_draining is already set
+     * because schemes like diskd can process I/O acks
+     * before sending another I/O request.    e.g. the following
+     * sequence of events: open request -> write request ->
+     * drainWriteQueue() -> queue full -> callbacks -> openDone() ->
+     * drainWriteQueue().
+     */
+    if (flags.write_draining)
+       return;
 
     if (!theFile->canWrite())
         return;