From hsu@clinet.fi  Mon Oct 21 02:49:23 1996
Received: from hauki.clinet.fi (root@hauki.clinet.fi [194.100.0.1])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id CAA04156
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 21 Oct 1996 02:49:21 -0700 (PDT)
Received: from katiska.clinet.fi (root@katiska.clinet.fi [194.100.0.4]) by hauki.clinet.fi (8.7.6/8.6.4) with ESMTP id LAA24999 for <FreeBSD-gnats-submit@freebsd.org>; Mon, 21 Oct 1996 11:49:12 +0200 (EET)
Received: (root@localhost) by katiska.clinet.fi (8.7.6/8.6.4) id MAA15373; Mon, 21 Oct 1996 12:49:11 +0300 (EET DST)
Message-Id: <199610210949.MAA15373@katiska.clinet.fi>
Date: Mon, 21 Oct 1996 12:49:11 +0300 (EET DST)
From: Heikki Suonsivu <hsu@clinet.fi>
Reply-To: hsu@clinet.fi
To: FreeBSD-gnats-submit@freebsd.org
Subject: read-only nfs mount: panic leaf should be empty
X-Send-Pr-Version: 3.2

>Number:         1856
>Category:       kern
>Synopsis:       read-only nfs mount: panic leaf should be empty
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    peter
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 21 02:50:01 PDT 1996
>Closed-Date:    Mon Sep 4 15:12:45 PDT 2000
>Last-Modified:  Mon Sep 04 15:13:12 PDT 2000
>Originator:     Heikki Suonsivu
>Release:        FreeBSD 2.2-CURRENT i386
>Organization:
Clinet, Espoo, Finland
>Environment:

-current from about three weeks back

>Description:

I tried to upgrade current from about three weeks back in one of our
modem servers:

mount -o ro master:/usr /master/usr
cd /usr/src (/usr/src and /usr/obj are links to /master/usr/{src,obj})
make reinstall |& tee /var/tmp/reinstall.log |& mail hsu@clinet.fi

It always crashed after doing mtrees.

This probably is because of read-only mount, though there is a possibility
that root and usr being async mounted also contribute to this.  I have
installed several systems with / and /usr async mounted so I think
read-only mount is more probable cause.

osku# gdb -k kernel.58 vmcore.58
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.13 (i386-unknown-freebsd), 
Copyright 1994 Free Software Foundation, Inc...
IdlePTD 24b000
current pcb at 1f7e5c
panic: leaf should be empty
#0  boot (howto=256) at ../../kern/kern_shutdown.c:237
237                                     dumppcb.pcb_cr3 = rcr3();
(kgdb) bt
#0  boot (howto=256) at ../../kern/kern_shutdown.c:237
#1  0xf010ea62 in panic (fmt=0xf0129cf2 "leaf should be empty")
    at ../../kern/kern_shutdown.c:361
#2  0xf012a007 in lookup (ndp=0xefbfff0c) at ../../kern/vfs_lookup.c:405
#3  0xf0129b00 in namei (ndp=0xefbfff0c) at ../../kern/vfs_lookup.c:149
#4  0xf012d7a5 in unlink (p=0xf2d7d800, uap=0xefbfff94, retval=0xefbfff84)
    at ../../kern/vfs_syscalls.c:986
#5  0xf01c6427 in syscall (frame={tf_es = 39, tf_ds = 39, tf_edi = -272639680, 
      tf_esi = -272639512, tf_ebp = -272639584, tf_isp = -272629788, 
      tf_ebx = -272639442, tf_edx = 0, tf_ecx = -272639697, tf_eax = 10, 
      tf_trapno = 7, tf_err = 7, tf_eip = 103509, tf_cs = 31, tf_eflags = 582, 
      tf_esp = -272639704, tf_ss = 39}) at ../../i386/i386/trap.c:891
#6  0xf01be615 in Xsyscall ()
#7  0x1266 in ?? ()
#8  0x107f in ?? ()
(kgdb) 

ftp://ftp.clinet.fi/pub/FreeBSD/crashdumps/ts/*.{57,58}.gz

>How-To-Repeat:

Above description worked; probably any load might do it ?

>Fix:
	


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->peter 
Responsible-Changed-By: peter 
Responsible-Changed-When: Sun Apr 26 00:46:49 PDT 1998 
Responsible-Changed-Why:  
I'll look into this. 

From: msaitoh <msaitoh@spa.is.uec.ac.jp>
To: freebsd-gnats-submit@freebsd.org, hsu@clinet.fi
Cc: msaitoh@spa.is.uec.ac.jp
Subject: Re: kern/1856: read-only nfs mount: panic leaf should be empty
Date: Wed, 13 May 1998 10:26:04 +0900

  Please try following patch:
 
 *** nfs_vnops.c.orig	Thu May 29 03:26:45 1997
 --- nfs_vnops.c	Wed May 13 08:42:27 1998
 ***************
 *** 870,879 ****
   	int v3 = NFS_ISV3(dvp);
   	struct proc *p = cnp->cn_proc;
   
   	if ((flags & ISLASTCN) && (dvp->v_mount->mnt_flag & MNT_RDONLY) &&
   	    (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME))
   		return (EROFS);
 - 	*vpp = NULLVP;
   	if (dvp->v_type != VDIR)
   		return (ENOTDIR);
   	lockparent = flags & LOCKPARENT;
 --- 870,879 ----
   	int v3 = NFS_ISV3(dvp);
   	struct proc *p = cnp->cn_proc;
   
 + 	*vpp = NULLVP;
   	if ((flags & ISLASTCN) && (dvp->v_mount->mnt_flag & MNT_RDONLY) &&
   	    (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME))
   		return (EROFS);
   	if (dvp->v_type != VDIR)
   		return (ENOTDIR);
   	lockparent = flags & LOCKPARENT;
 
 ----------------------------------------------------------
 		SAITOH Masanobu (msaitoh@spa.is.uec.ac.jp,
 		                 msaitoh@netbsd.org)
 		University of Electro-Communications
State-Changed-From-To: open->feedback 
State-Changed-By: peter 
State-Changed-When: Tue May 12 22:49:27 PDT 1998 
State-Changed-Why:  
Fix applied in rev 1.84 and 1.36.2.6.  Please check if this works for you. 
(fix from msaitoh@spa.is.uec.ac.jp) 
State-Changed-From-To: feedback->closed 
State-Changed-By: peter 
State-Changed-When: Mon Sep 4 15:12:45 PDT 2000 
State-Changed-Why:  
Believed fixed, no news otherwise. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=1856 
>Unformatted:
