Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!oliveb!pyramid!voder!jeff From: jeff@voder.UUCP (Jeff Gilliam) Newsgroups: comp.bugs.4bsd Subject: Re: tmscp tape drives give "hard error" on reading too small a record Message-ID: <2901@voder.UUCP> Date: Tue, 21-Apr-87 00:50:00 EST Article-I.D.: voder.2901 Posted: Tue Apr 21 00:50:00 1987 Date-Received: Wed, 22-Apr-87 01:38:21 EST References: <1681@husc6.UUCP> <2412@ulysses.homer.nj.att.com> <1696@husc6.UUCP> <2426@ulysses.homer.nj.att.com> Followup-To: comp.unix.wizards Organization: National Semiconductor, Santa Clara Lines: 34 Keywords: tmscp, TU81, DEC Some facts for consideration: 1) Is is *extremely* dangerous to silently discard data. That's why tape controllers have a special error bit to indicate that the record length was larger than number of bytes read. 2) All the 4.3 BSD tape drivers silently ignore a "record too long" error if the raw device is being accessed. They even have a comment to the effect that this behavior is deliberate, though it doesn't explain why. 3) The man pages (at least since 7th Edition) indicate that a long record returns an error indication. Conclusions? This situation ought to return an error. A unique error code would be ideal (I kinda like ERLE: Record Length Error) to enable user code to distinguish between a problem reading the tape and a simple record length error. This error should *not* provoke a printf to the system console; it's not indicative of either a hardware or kernel software problem. If somebody really feels it necessary (examples, please) an ioctl() could be added to cause the drive to ignore rle's (analagous to 4.3's ioctl() to ignore EOT). The end result is that "naive" code won't lose data without receiving some indication. (I'm glossing over "stupid" code that ignores the return value from read(). But then, such code is likely to have worse problems than this ... like ignoring EOF.) And, "sophisticated" code can control how it deals with record length errors. Sounds like the best of all possible worlds. -- Jeff Gilliam {ucbvax,pyramid,nsc}!voder!jeff