From owner-freebsd-bugs Wed Feb 4 00:30:03 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA11818 for freebsd-bugs-outgoing; Wed, 4 Feb 1998 00:30:03 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: (from gnats@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA11811; Wed, 4 Feb 1998 00:30:02 -0800 (PST) (envelope-from gnats) Received: from neunacht.netgsi.com (neunacht.netgsi.com [192.55.203.37]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA11606 for ; Wed, 4 Feb 1998 00:27:59 -0800 (PST) (envelope-from cjohnson@neunacht.netgsi.com) Received: (from cjohnson@localhost) by neunacht.netgsi.com (8.8.8/8.8.6) id DAA00475; Wed, 4 Feb 1998 03:27:58 -0500 (EST) Message-Id: <199802040827.DAA00475@neunacht.netgsi.com> Date: Wed, 4 Feb 1998 03:27:58 -0500 (EST) From: "Christopher T. Johnson" Reply-To: cjohnson@neunacht.netgsi.com To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: kern/5643: NCR 810/815 do not handle rewind correctly Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org X-To-Unsubscribe: mail to majordomo@FreeBSD.org "unsubscribe freebsd-bugs" >Number: 5643 >Category: kern >Synopsis: NCR 810/815 do not handle rewind correctly >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Feb 4 00:30:01 PST 1998 >Last-Modified: >Originator: Christopher T. Johnson >Organization: NetGSI, INC >Release: FreeBSD 3.0-CURRENT i386 >Environment: Problem presents itself with both an 810 and 815 SCSI card. In both a 486 (AMD X6/133 40MB) and a P166 Dual processor system. The dual processor system shows the problem in both uni and multi processor mode. Problem has been present in CURRENT since atleast Nov 1st 1997. >Description: When the following sequence is executed with an NCR810/815 SCSI control card, the second rewind generates an I/O error with no message logged. open("/dev/nrst0", O_RDONLY); rewind via ioctl(); read(fd, buffer, 32k); close(fd); open("/dev/nrst0", O_RDWR); rewind via ioctl(); The type drive is an older EXABYTE 8200 and it is more than a little slow in doing any tape motion. >How-To-Repeat: #include #include "tapeio.h" main() { int fd; char buffer[32768]; char bout[32768]; int flag; strcpy(bout,"AMANDA: TAPESTART DATE X TAPE NET004\n"); fd = tape_open("/dev/nrst0", 0); /* O_RDONLY */ if (fd < 0) { perror("Tape open"); exit(1); } flag = tapefd_rewind(fd); if (flag < 0 ) { perror("rewind 1"); exit(2); } flag = read(fd, buffer, 32768); if (flag != 32768) { perror("read"); } flag = close(fd); if (flag != 0) { perror("tape close"); exit(4); } fd = tape_open("/dev/nrst0", 2); /* O_RDWR */ if (fd < 0) { perror("open rdwr"); exit(4); } flag = tapefd_rewind(fd); if (flag < 0) { perror("rewind 2"); fprintf(stderr,"Trying to rewind a second time\n"); sleep(5); flag = tapefd_rewind(fd); if (flag < 0) { perror("rewind 3"); } } flag = write(fd, bout, 32768); if (flag != 32768) { perror("write"); exit(6); } flag = close(fd); if (flag != 0) { perror("close 2"); exit(7); } exit(0); } #include int tapefd_rewind(tapefd) int tapefd; { struct mtop mt; mt.mt_op = MTREW; mt.mt_count = 1; return ioctl(tapefd, MTIOCTOP, &mt); } int tape_open(filename, mode) char *filename; int mode; { return open(filename, mode); } >Fix: Because of the fact that the work around shows that there is a timing need I suspect that the ncr code is not waiting for something to settle. This problem does NOT happen with the same equipment but with an Adaptec 1542cp >Audit-Trail: >Unformatted: