Subject: kern/642: lstat() returns wrong inode for symlink?
To: None <gnats-admin@sun-lamp.cs.berkeley.edu>
From: Simon J. Gerraty <sjg@bilbo.dn.itg.telecom.com.au>
List: netbsd-bugs
Date: 12/14/1994 21:35:04
>Number:         642
>Category:       kern
>Synopsis:       lstat("/sys") gives st_ino==2 but its a symlink.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 14 21:35:03 1994
>Originator:     Simon J. Gerraty
>Organization:
Zen Programming...
>Release:        1.0
>Environment:
	
System: NetBSD bilbo.dn.itg.telecom.com.au 1.0 NetBSD 1.0 (FIREWALL) #2: Thu Nov 17 15:12:36 EST 1994 root@bilbo.dn.itg.telecom.com.au:/src/sys/arch/i386/compile/FIREWALL i386


>Description:
I'm having trouble building the Linux NFS server on NetBSD.
I don't want it to replace NFS, its to build an NFS proxy for our 
firewall.  Anyway, it attempts to map dev/inodes to pseudo-inodes...
this breaks because a symlink such as:

root:188# ls -idl /sys /usr/src /src /src/sys         
   2 lrwxr-xr-x   1 root  wheel   11 Nov 17 16:58 /sys@ -> usr/src/sys
   2 lrwxr-xr-x   1 root  wheel    4 Nov 17 16:29 /usr/src@ -> /src
   2 drwxr-xr-x  19 root  wheel  512 Dec  7 15:18 /src/
7552 drwxrwxr-x  25 root  wheel  512 Nov  7 11:32 /src/sys/

Thus /sys and /src get the same dev/inode as the root directory!

psi=0x2, dev=0(0,0), ino=0x2, path=/
psi=0x2, dev=0(0,0), ino=0x2, path=/sys

this causes the server to assume it is stuffed...

I think the Linux NFS server is seriously broken, but the above output
from ls -idl seems broken too.
>How-To-Repeat:
	
>Fix:
	
>Audit-Trail:
>Unformatted: