From owner-freebsd-current@FreeBSD.ORG Thu Sep 29 07:01:22 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EB91A16A41F for ; Thu, 29 Sep 2005 07:01:22 +0000 (GMT) (envelope-from umka@sevcity.net) Received: from mail.sevcity.net (ns.sevcity.net [193.47.166.213]) by mx1.FreeBSD.org (Postfix) with ESMTP id 36BA943D48 for ; Thu, 29 Sep 2005 07:01:21 +0000 (GMT) (envelope-from umka@sevcity.net) Received: from mail.sevcity.net (service.sevcity [127.0.0.1]) by mail.sevcity.net (Postfix) with ESMTP id 9D457170007; Thu, 29 Sep 2005 10:00:59 +0300 (EEST) Received: from berloga.shadowland (berloga.shadowland [172.20.2.3]) by mail.sevcity.net (Postfix) with ESMTP id 07376170004; Thu, 29 Sep 2005 10:00:59 +0300 (EEST) Received: from berloga.shadowland (berloga.shadowland [127.0.0.1]) by berloga.shadowland (8.12.11/8.12.11) with ESMTP id j8T71J5p005206; Thu, 29 Sep 2005 10:01:19 +0300 Received: (from root@localhost) by berloga.shadowland (8.12.11/8.12.11/Submit) id j8T71IR5005204; Thu, 29 Sep 2005 10:01:18 +0300 From: Alex Lyashkov To: Peter Edwards In-Reply-To: <34cb7c8405092815247dc89bf6@mail.gmail.com> References: <34cb7c8405092815247dc89bf6@mail.gmail.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: SevcityNet Message-Id: <1127977278.3383.7.camel@berloga.shadowland> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-16) Date: Thu, 29 Sep 2005 10:01:18 +0300 X-Virus-Scanned: ClamAV using ClamSMTP X-Mailman-Approved-At: Thu, 29 Sep 2005 11:53:46 +0000 Cc: freebsd-current@freebsd.org Subject: Re: biodone panics X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2005 07:01:23 -0000 > > the call to wakeup may set in motion some events that cause the bio to > be freed. By the time the mtx_unlock completes, "bp" could point to an > invalid bio, and the "if (bp->bio_done != NULL)" is bogus. True? > Shouldn't it be > > > biodone(struct bio *bp) > > { > > void (*done)(struct bio *); > > > > mtx_lock(&bdonelock); > > bp->bio_flags |= BIO_DONE; > > done = bp->bio_done > > if (done == NULL) > > wakeup(bp); > > mtx_unlock(&bdonelock); > > if (done != NULL) > > bp->bio_done(bp); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ posible if( done != NULL ) done(bp); ? > > } > > Anyone agree?