Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!seismo!gatech!ulysses!ggs From: ggs@ulysses.UUCP Newsgroups: comp.bugs.4bsd Subject: Re: tmscp tape drives give "hard error" on reading too small a record Message-ID: <2412@ulysses.homer.nj.att.com> Date: Fri, 17-Apr-87 21:27:55 EST Article-I.D.: ulysses.2412 Posted: Fri Apr 17 21:27:55 1987 Date-Received: Sat, 18-Apr-87 08:53:22 EST References: <1681@husc6.UUCP> Organization: AT&T Bell Laboratories, Murray Hill Lines: 37 Keywords: tmscp, TU81, DEC Summary: truncated reads ARE an error! In article <1681@husc6.UUCP>, dudek@endor.UUCP writes: > Index: /usr/sys/vaxuba/tmscp.c 4.3BSD, Ultrix 1.2 > > Description: > When reading a tape written with a blocksize larger than you are > using to read, any tmscp tape drive (e.g., TU81, TK50) will die > with a kernel printf "hard error: record data truncated" and an > I/O error. This should not be an error when using the raw device. Please don't destroy what feeble progress has been made in improving UNIX system tape drivers. I agree with your objection to the printf, but there should be some notification when data is lost. ... > ! if (st != M_ST_TAPEM) > { > tprintf(tms->tms_ttyp, > "tms%d: hard error bn%d\n", Yes, this is a nasty thing to do. A simple arror return would have been much more appropriate. There should be an error code that signals "data lost", but in lieu of that, ENOMEM is a crude substitute. The problem with quietly returning the head of truncated blocks is that people may do quite a bit of processing on the resulting trash before they realize something is missing. "But the C program won't compile" or "tar will complain soon enough" you say? Not in my building; we get a lot of IBM tapes with simple data on them. If you guess the wrong block size but get the right logical record length, many logical records are neatly snipped off and thrown into the bit bucket. It may take several days and a few thousand dollars before the mistake is discovered. -- Griff Smith AT&T (Bell Laboratories), Murray Hill Phone: 1-201-582-7736 UUCP: {allegra|ihnp4}!ulysses!ggs Internet: ggs@ulysses.uucp