Subject: unlink() and read-only NFS mounted filesystems
To: None <current-users@NetBSD.ORG>
From: None <mika@cs.caltech.edu>
List: current-users
Date: 03/04/1996 13:02:40
Hi people, 
   I have found a problem with the latest netbsd-current (well as of
Sunday morning, PST) which showed up when the system panicked trying to
run emacs.

I have /usr NFS-mounted ro from another -current system (same kernel 
sources), and when I run the following:

main()
{
    unlink("/usr/local/lib/emacs/19.28");
}

the system panics with the message "leaf should be empty"

Here are some possibly relevant stats:


(3)stun4p:/tmp>ls -l /usr/local/lib/emacs
total 4
drwxrwsr-t  5 root  wheel  512 Feb 22 12:23 19.28/
lrwxr-xr-x  1 root  wheel   26 Mar  4 12:09 lock@ -> /ufs/scratch/emacslib/lock
drwxrwsr-t  2 root  wheel  512 Feb 27 13:58 site-lisp/
(5)stun4p:/tmp>/sbin/mount
/dev/wd0a on / type ffs (local)
/dev/wd0e on /var type ffs (local)
/dev/wd0f on /var/tmp type ffs (local)
stun4q:/usr on /usr type nfs (read-only)
amd:61 on /ufs type nfs
jove:/other/arpa on /tmp_mnt/jove/other/arpa type nfs
csvax:/dept/mail on /tmp_mnt/csvax/dept/mail type nfs
mercury:/students on /tmp_mnt/mercury/students type nfs
(6)stun4p:/tmp>
(7)stun4p:/tmp>rpcinfo -p
   program vers proto   port
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    300019    1   udp   1023  amd
    100001    1   udp   1059  rstatd
    100001    2   udp   1059  rstatd
    100001    3   udp   1059  rstatd
    100002    2   udp   1060  rusersd
    100002    3   udp   1060  rusersd
    100008    1   udp   1061  walld
    100012    1   udp   1062  sprayd
(8)stun4p:/tmp>rpcinfo -p stun4q
   program vers proto   port
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100003    2   udp   2049  nfs
    100005    1   udp    655  mountd
    100003    2   tcp   2049  nfs
    100005    1   tcp    656  mountd
    300019    1   udp   1023  amd
...
stuff from the kernel config:
options         SWAPPAGER       # paging; REQUIRED
options         VNODEPAGER      # mmap() of files
options         DEVPAGER        # mmap() of devices

#options                DDB             # in-kernel debugger
makeoptions     DEBUG="-g"      # compile full symbol table
options         DIAGNOSTIC      # internally consistency checks
options         KTRACE          # system call tracing, a la ktrace(1)
...
options         FFS             # UFS
#options                QUOTA           # UFS quotas
options         LFS             # log-structured file system
options         MFS             # memory file system

options         NFSCLIENT       # Network File System client
options         NFSSERVER       # Network File System server

and here's ktrace.out:

   217 a.out    CALL  mmap(0x1006e000,0x99cc,0x7,0x1014,0xffffffff,0,0,0)
   217 a.out    RET   mmap 268886016/0x1006e000
   217 a.out    CALL  close(0x5)
   217 a.out    RET   close 0
   217 a.out    CALL  munmap(0x10017000,0x1000)
   217 a.out    RET   munmap 0
   217 a.out    CALL  close(0x4)
   217 a.out    RET   close 0
   217 a.out    CALL  close(0x3)
   217 a.out    RET   close 0
   217 a.out    CALL  unlink(0x175c)
   217 a.out    NAMI  "/usr/local/lib/emacs/19.28"

and then the system dies with 
"leaf should be empty"

Enjoy! :)