From: wessels <> Date: Fri, 13 Apr 2007 02:36:56 +0000 (+0000) Subject: A fix for the !flags.write_draining assertion. Due to the way diskd X-Git-Tag: SQUID_3_0_PRE6~106 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2eaddcc28be17795b60156998812d4a84392de73;p=thirdparty%2Fsquid.git A fix for the !flags.write_draining assertion. Due to the way diskd works, drainWriteQueue() could get called twice in the stack. If so, just return when the write_draining flag is set. --- diff --git a/src/fs/ufs/store_io_ufs.cc b/src/fs/ufs/store_io_ufs.cc index d2cb7fd2be..7966c40907 100644 --- a/src/fs/ufs/store_io_ufs.cc +++ b/src/fs/ufs/store_io_ufs.cc @@ -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;