[comp.bugs.4bsd] Can someone explain this 4.1bsd file system oddity?

marcl@3Com.COM (Marc Lavine) (07/16/87)

We are running 4.1bsd on a VAX 11/750.  For about the third or fourth
time in the last couple of months messages like the following appeared
in /usr/lib/news/errlog:

Jul 15 17:47	batch	/usr/spool/news/rec/games/chess/243
, expected 1024 bytes, got 1111

This time, the message appeared over 500 times, corresponding to that
many times a small batch of news had been queued for uucp.  This
message occurs when batch reads (using getc) a different number of
bytes from a file it is batching than is reported by fstat.  The first
time this occurred, I thought that this was caused by a bug in batch
or in the 4.1 stdio library.  Then I tried accessing the troublesome
file using other programs (cat, less, cp).  None of them were able to
access all of the file properly.  Using less, I was able to read up to
a point in the file at which I got an EOF message.  This point was
actually somewhere in the middle of the file.  If I instructed less to
jump to the end of the file it was able to seek to the real
end-of-file and read backwards until in encountered an error.

In the error message, the 1024 number is the number of bytes actually
read and the 1111 number is the number of bytes reported by fstat.
Since the number of bytes actually read is a multiple of the disk
block size, I guess that the premature EOF might have been caused by a
damaged inode which pointed to some invalid disk block.  Fsck didn't
report any problems when I ran it against the file system in question.

Has anyone seen this problem before?  If so, what was the cause?  Any
ideas of what is likely to cause this to occur or what I might be able
to do to prevent it from occurring?  My best guess is that it might be
caused by a wild store from some local modifications I made to our DH
driver.

Any help would be greatly appreciated.  I'd prefer to get responses by
mail since I rarely have time to read the two groups I'm posting this
to.

	Thanks,
	Marc Lavine
-- 
Marc Lavine			Internet: marcl%3Com.COM@Sun.COM
Smart mailer: marcl@3Com.COM	UUCP: ...{oliveb|sun}!3comvax!marcl