4.2 BSD file/inode counts less than zero.

James Bray jbray at bbncca.ARPA
Fri Feb 24 14:14:53 AEST 1984


  Yes, that's cute, isn't it? [sys/sys2.c]close(), in my kernel, v7,
and sys5, all do something like
	u.u_ofile[up->fdes] = NULL;
	closef(fp);

  4.2bsd [sys/kern_descrip.c] has, if I may quote,
	closef(fp);
	/* WHAT IF u.u_error ? */
	u.u_ofile[uap->i] = NULL;

  Well, what if, indeed. I wonder why they felt they had to reverse these
lines. I don't know why one would want to keep a pointer to a structure
that one was trying to get rid of, unless one was to change one's mind
(which is unfortunately what seems to be happening)... It would certainly be
better to lose a pointer to something you still have than to have a pointer
to /dev/rdisk00... I wonder if it wasn't just an editing slip. I've always
had a morbid fear of those myself... Your editor is in a bad mood, or your
fd's get crossed, and somewhere, deep in your kernel, where you don't look
very often but don't get me wrong, I'm not trying to put down say acct.c or
something, but just say it was in there, and a "==" got changed to a "="
(which used to be my favorite little error, but I am wary of it now), and every
six months, like clockwork, it would cause a wild jump into the disk start
routine with just the right junk on the stack to start up spiral writes on
all your drives... I dunno, maybe lint would catch it... If you were
lucky... (diabolical laughter, SCTV 3D noises, and then
"pani~]s$.7"...)

--Jim Bray



More information about the Comp.unix.wizards mailing list