From dima@tejblum.dnttm.rssi.ru  Fri May  2 08:30:08 1997
Received: from helios.dnttm.ru (uutejb@dnttm.wave.ras.ru [194.85.104.197])
          by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id IAA06242
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 2 May 1997 08:30:04 -0700 (PDT)
Received: (from uutejb@localhost)
	by helios.dnttm.ru (8.8.5/8.8.5/IP-2) with UUCP id TAA27082
	for FreeBSD-gnats-submit@freebsd.org; Fri, 2 May 1997 19:30:10 +0400
Received: (from dima@localhost)
	by tejblum.dnttm.rssi.ru (8.8.5/8.8.5) id TAA00524;
	Fri, 2 May 1997 19:32:42 +0400 (MSD)
Message-Id: <199705021532.TAA00524@tejblum.dnttm.rssi.ru>
Date: Fri, 2 May 1997 19:32:42 +0400 (MSD)
From: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
Reply-To: dima@tejblum.dnttm.rssi.ru
To: FreeBSD-gnats-submit@freebsd.org
Subject: After unmounting DEVFS, mounting DEVFS cause panic: page fault
X-Send-Pr-Version: 3.2

>Number:         3469
>Category:       kern
>Synopsis:       After unmounting DEVFS, mounting DEVFS cause panic: page fault
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May  2 08:40:01 PDT 1997
>Closed-Date:    Sat May 3 23:21:21 MET DST 1997
>Last-Modified:  Sat May  3 23:23:12 MET DST 1997
>Originator:     Dmitrij Tejblum
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
>Environment:

FreeBSD tejblum.dnttm.rssi.ru 3.0-CURRENT FreeBSD 3.0-CURRENT #6: Fri May  2 17:58:13 MSD 1997     dima@tejblum.dnttm.rssi.ru:/usr/src/sys/compile/DIMA  i386

devfs     /devs   devfs   rw      0    0

in /etc/fstab

>Description:

After 'umount /devs', any attempt to mount DEVFS cause 'panic: page
fault'. It is due to missing cleanup in devfs_dn_free().

>How-To-Repeat:

First, apply patch from kern/3276, or you will repeat kern/3276 :-)

umount /devs
mount /devs

>Fix:

*** /usr/src/sys/miscfs/devfs/devfs_tree.c.00	Fri Apr 11 22:56:28 1997
--- /usr/src/sys/miscfs/devfs/devfs_tree.c	Fri May  2 17:57:04 1997
***************
*** 496,501 ****
--- 496,507 ----
  	if(--dnp->links <= 0 ) /* can be -1 for initial free, on error */
  	{
  		/*probably need to do other cleanups XXX */
+ 		if (dnp->nextsibling != dnp) {
+ 			dn_p* prevp = dnp->prevsiblingp;
+ 			*prevp = dnp->nextsibling;
+ 			dnp->nextsibling->prevsiblingp = prevp;
+ 			
+ 		}
  		if(dnp->type == DEV_SLNK) {
  			free(dnp->by.Slnk.name,M_DEVFSNODE);
  		}

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: joerg 
State-Changed-When: Sat May 3 23:21:21 MET DST 1997 
State-Changed-Why:  
Suggested fixes from PR # 3276 and 3469 applied, in rev 1.36 and 
1.17 of devfs_tree.c, and devfs_vfsops.c, respectively. 

Thanks for the fixes! 

>Unformatted:
 
