[7478] in Athena Bugs

home help back first fref pref prev next nref lref last post

AFS file link count

daemon@ATHENA.MIT.EDU (John Carr)
Sun Apr 28 14:12:31 1991

To: bugs@ATHENA.MIT.EDU, bug-afs@ATHENA.MIT.EDU
Date: Sun, 28 Apr 91 14:12:16 EDT
From: John Carr <jfc@ATHENA.MIT.EDU>


The AFS client allocates an unsigned char to hold the link count of a file.
The LinkCount field of struct mstat should be an unsigned short.  The AFS
server and the rest of the kernel allow 16 bit link counts.  A file with 256
links appears to have 0 links according to ls.

	$ ls file.252
	-rw-rw-r--255 jfc             2 Apr 28 14:04 file.252
	$ ln file.252 file.253
	$ ls file.253
	-rw-rw-r--  0 jfc             2 Apr 28 14:04 file.253
	$ rm file.253
	$ ls file.252
	-rw-rw-r--255 jfc             2 Apr 28 14:04 file.252
	$

I don't understand why a char instead of a short was used -- on any machine
which aligns longs to 2 byte boundaries, the structure will be no smaller.


home help back first fref pref prev next nref lref last post