Coda File System

BSD kernel: wierd coda behavior - directory appears empty on first ls

From: Greg Troxel <gdt_at_fnord.ir.bbn.com>
Date: 28 Feb 2001 20:59:57 -0500
Coda server and client were built from cvs within a week.
client is freebsd 4.2+kame 20001221.  server is netbsd 1.4.x+kame a
bit older.

I did the following:
vutil shutdown
venus #starts normally

clog #works fine
cotkens # works fine

cd	#in /home/gdt
cd %co	# is symlink to /coda/home/gdt
l	# alias for ls -l
# NO OUTPUT
l	# just run the same thing again
# normal output

I investigated further, and convinced myself that venus already had
the bits (codacon showed no traffic in many cases).
I read the src for /bin/ls and fts_* (man 3 fts) from libc.
It's trying to play games about avoiding stats by counting links.

So, I ran stat (via guile!):

guile> (chdir "%co")
guile> (stat:nlink (stat "."))    
26
guile> (stat:nlink (stat "."))    
26
guile> (stat ".")
; first number is decimal st_dev element
#(83951375 2082 16895 26 0 65534 1 2048 983408607 983408607 0 0 4 directory 511)
guile> (stat ".")
#(83951375 2082 16895 26 0 65534 1 2048 983408607 983408607 0 0 4 directory 511)
guile> (getcwd)
ERROR: In procedure getcwd in expression (getcwd):
ERROR: No such file or directory
ABORT: (system-error)
guile> (getcwd)
"/coda/home/gdt"
guile> (stat ".")
#(0 2082 16895 26 0 65534 1 2048 983408607 983408607 0 0 4 directory  511)

getcwd failed once and then worked, which is odd.

So, it seems that the 'st_dev' field returned 83951375 and then later 0.
In hex, that's 500FF10, which is kind of odd.
If I'm doing this right, that's 255, 0x05000010.

(It seems broken that the ctimes are 0, but that's probably easy once
one decides what it _should_ be.)

I tried things again:

garlic gdt 142 ~ > guile
guile> (chdir "%co")
guile> (stat ".")
#(83951376 2082 16895 26 0 65534 1 2048 983408607 983408607 0 0 4
directory 511)
guile> (stat ".")
#(83951376 2082 16895 26 0 65534 1 2048 983408607 983408607 0 0 4
directory 511)
guile> (stat ".")
#(83951376 2082 16895 26 0 65534 1 2048 983408607 983408607 0 0 4
directory 511)
guile> (stat ".")
#(83951376 2082 16895 26 0 65534 1 2048 983408607 983408607 0 0 4
directory 511)
guile> (define a (opendir "."))
guile> a
#<directory stream 80a88a0>
guile> (readdir a)
"CDROMS"
guile> (stat ".")
#(0 2082 16895 26 0 65534 1 2048 983408607 983408607 0 0 4 directory
511)



I'm guessing that some kind of stat information isn't properly
initialized. 

Any clues/hints?
Received on 2001-02-28 21:00:06