From owner-freebsd-current@FreeBSD.ORG Thu Jan 15 10:13:14 2004 Return-Path: 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 07A5016A4CE; Thu, 15 Jan 2004 10:13:14 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3101943D2D; Thu, 15 Jan 2004 10:13:12 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 148AE530A; Thu, 15 Jan 2004 19:13:11 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 19CDC5309; Thu, 15 Jan 2004 19:13:01 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id 8C3B333C9A; Thu, 15 Jan 2004 19:13:01 +0100 (CET) To: Scott Long References: <4006D6B5.3050601@freebsd.org> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Thu, 15 Jan 2004 19:13:01 +0100 In-Reply-To: <4006D6B5.3050601@freebsd.org> (Scott Long's message of "Thu, 15 Jan 2004 11:06:45 -0700") Message-ID: User-Agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on flood.des.no X-Spam-Level: ss X-Spam-Status: No, hits=2.6 required=5.0 tests=RCVD_IN_DYNABLOCK, RCVD_IN_SORBS autolearn=no version=2.61 cc: "Robin P. Blanchard" cc: current@freebsd.org Subject: Re: Panic with this morning's (~9am EDT, 15 jan 2004) sources. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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, 15 Jan 2004 18:13:14 -0000 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Scott Long writes: > This is likely due to the new fd allocation code. DES, can you please > enable WITNESS and INVARIANTS in your test system and fix this? I have INVARIANTS (the fdalloc code is riddled with KASSERTS) but forgot to test with WITNESS. In any case, the fix is pretty straightforward; please try the attached patch. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=fdalloc-witness.diff Index: sys/kern/kern_descrip.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_descrip.c,v retrieving revision 1.219 diff -u -r1.219 kern_descrip.c --- sys/kern/kern_descrip.c 15 Jan 2004 10:15:03 -0000 1.219 +++ sys/kern/kern_descrip.c 15 Jan 2004 18:11:48 -0000 @@ -1430,8 +1430,11 @@ FILEDESC_LOCK_ASSERT(fdp, MA_OWNED); newfdp = fdinit(fdp); FILEDESC_LOCK(newfdp); - if (fdp->fd_lastfile >= newfdp->fd_nfiles) + while (fdp->fd_lastfile >= newfdp->fd_nfiles) { + FILEDESC_UNLOCK(fdp); fdgrowtable(newfdp, fdp->fd_lastfile + 1); + FILEDESC_LOCK(fdp); + } KASSERT(newfdp->fd_nfiles > fdp->fd_lastfile, ("fdgrowtable() failed to grow table")); /* copy everything except kqueue descriptors */ --=-=-=--