From owner-freebsd-hackers Wed Feb 26 21:50:45 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id VAA06835 for hackers-outgoing; Wed, 26 Feb 1997 21:50:45 -0800 (PST) Received: from dg-rtp.dg.com (dg-rtp.rtp.dg.com [128.222.1.2]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id VAA06815 for ; Wed, 26 Feb 1997 21:50:36 -0800 (PST) Received: by dg-rtp.dg.com (5.4R3.10/dg-rtp-v02) id AA26705; Thu, 27 Feb 1997 00:50:05 -0500 Received: from ponds by dg-rtp.dg.com.rtp.dg.com; Thu, 27 Feb 1997 00:50 EST Received: from lakes.water.net (lakes [10.0.0.3]) by ponds.water.net (8.8.3/8.7.3) with ESMTP id XAA04904 for ; Wed, 26 Feb 1997 23:30:37 -0500 (EST) Received: (from rivers@localhost) by lakes.water.net (8.8.3/8.6.9) id XAA29550 for freebsd-hackers@freefall.cdrom.com; Wed, 26 Feb 1997 23:35:55 -0500 (EST) Date: Wed, 26 Feb 1997 23:35:55 -0500 (EST) From: Thomas David Rivers Message-Id: <199702270435.XAA29550@lakes.water.net> To: ponds!freefall.cdrom.com!freebsd-hackers Subject: Perhaps an interesting point with the dup-alloc panics.. Content-Type: text Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Ok - This is 2.1.6.1 - no patches, except for a couple of printf()'s to see what's going on. One of the key items I've just discovered comes from the following printf() in ufs_disksubr.c. It's simply a printf() at the top of disksort() to indicate what block number is being added to the queue. *** ufs_disksubr.c.ori Mon Sep 18 02:15:15 1995 --- ufs_disksubr.c Wed Feb 26 22:21:51 1997 *************** *** 81,86 **** --- 81,88 ---- { register struct buf *bq; + printf("disksort: adding blkno %d to the queue\n", bp->b_pblkno); + /* If the queue is empty, then it's easy. */ if (ap->b_actf == NULL) { bp->b_actf = NULL; Now, when I run this, I expect to see something like (on the console): disksort: adding blkno 131904 to the queue disksort: adding blkno 131920 to the queue disksort: adding blkno 131936 to the queue disksort: adding blkno 131952 to the queue ... nice; simple lines - especially since disksort() should be splbio()'d. However, if we continue down, I'm seeing output like: disksort: adding blkno 131984 to the queue disksort: adding blkno 132000 to thedisksort: adding blkno 197712 to the queue disksort: adding blkno 197728 to the queue - now, the second line there isn't a typo - the printf() didn't finish before another disksort() printf started. Doesn't this imply that disksort was re-entered? With potentially terrible results to the buf-queues? Or, is there some other explanation for the strange output? Such a re-entrancy/buf-list problem would readily explain this. And, could simply be a missing splbio() before calling disksort()... [although, I scanned wd.c and didn't see it.] Again, I'm working with unaltered, except that previous diff; 2.1.6.1. Finally, I notice that if I put the newfs in a loop (so it presumably isn't read from anywhere and is in memory) I don't get this scenario. That could simply mean that disksort() was called to sort a different queue (in this case, the file system on the floppy.)... I'll have to check on that. - Dave Rivers -