From owner-freebsd-hackers Sat Jul 6 14:29:17 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DF10437B401 for ; Sat, 6 Jul 2002 14:29:06 -0700 (PDT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id C96A243E31 for ; Sat, 6 Jul 2002 14:29:00 -0700 (PDT) (envelope-from ticso@cicely5.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) (authenticated bits=0) by srv1.cosmo-project.de (8.12.3/8.12.3) with ESMTP id g66LSnMa016935 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK) for ; Sat, 6 Jul 2002 23:28:52 +0200 (CEST) (envelope-from ticso@cicely5.cicely.de) Received: from cicely5.cicely.de (localhost [IPv6:::1]) by cicely5.cicely.de (8.12.1/8.12.1) with ESMTP id g66LSnFJ045215 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 6 Jul 2002 23:28:49 +0200 (CEST)?g (envelope-from ticso@cicely5.cicely.de) Received: (from ticso@localhost) by cicely5.cicely.de (8.12.1/8.12.1/Submit) id g66LSnbA045214 for freebsd-hackers@freebsd.org; Sat, 6 Jul 2002 23:28:49 +0200 (CEST)?g (envelope-from ticso) Date: Sat, 6 Jul 2002 23:28:49 +0200 From: Bernd Walter To: freebsd-hackers@freebsd.org Subject: Troubles with sa(4) Message-ID: <20020706212848.GE23704@cicely5.cicely.de> Reply-To: ticso@cicely.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: FreeBSD cicely5.cicely.de 5.0-CURRENT i386 User-Agent: Mutt/1.5.1i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG If I run the following programm: #include #include int Tape_rewind(int fd) { struct mtop mo; mo.mt_op = MTREW; mo.mt_count = 0; if (ioctl(fd, MTIOCTOP, &mo) == -1) { return 1; } return 0; }; int Tape_fsf(int fd, int count) { struct mtop mo; mo.mt_op = MTFSF; mo.mt_count = count; if (ioctl(fd, MTIOCTOP, &mo) == -1) { return 1; } return 0; }; int main() { int fd; char buf[8192]; fd = open("/dev/nsa0", O_RDWR); Tape_rewind(fd); write(fd, buf, sizeof(buf)); Tape_rewind(fd); close(fd); fd = open("/dev/nsa0", O_RDWR); Tape_rewind(fd); read(fd, buf, sizeof(buf)); Tape_rewind(fd); Tape_fsf(fd, 1); close(fd) return 0; } I get the following result: [51]cicely13# ps -axl | grep tapefoo 0 263 261 0 -8 0 972 94 cbwait D+ p0 0:00.05 /home/ticso/tapefoo ktrace: [...] 263 tapefoo RET read 8192/0x2000 263 tapefoo CALL ioctl(0x3,MTIOCTOP,0xbfbfd890) 263 tapefoo RET ioctl 0 263 tapefoo CALL ioctl(0x3,MTIOCTOP,0xbfbfd890) It is the fsf that blocks. I had a -current from march on that machine and updated to see if the effect was already solved. [57]cicely13# dmesg Copyright (c) 1992-2002 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 5.0-CURRENT #0: Sat Jul 6 20:06:28 CEST 2002 root@cicely13.cicely.de:/var/d7/builder/FreeBSD-2002-07-03/src/sys/i386/compile/CICELY13 Preloaded elf kernel "/boot/kernel/kernel" at 0xc0388000. Timecounter "i8254" frequency 1193182 Hz Timecounter "TSC" frequency 132873443 Hz CPU: Pentium/P54C (132.87-MHz 586-class CPU) Origin = "GenuineIntel" Id = 0x52c Stepping = 12 Features=0x1bf real memory = 33554432 (32768K bytes) avail memory = 28942336 (28264K bytes) Intel Pentium detected, installing workaround for F00F bug npx0: on motherboard npx0: INT 16 interface pcib0: at pcibus 0 on motherboard pci0: on pcib0 isab0: at device 7.0 on pci0 isa0: on isab0 atapci0: port 0xf000-0xf00f at device 7.1 on pci0 ata0: at 0x1f0 irq 14 on atapci0 ata1: at 0x170 irq 15 on atapci0 ahc0: port 0x6000-0x60ff mem 0xe4001000-0xe4001fff irq 9 at device 10.0 on pci0 aic7880: Ultra Wide Channel A, SCSI Id=7, 16/253 SCBs de0: port 0x6100-0x617f mem 0xe4000000-0xe400007f irq 12 at device 11.0 on pci0 de0: SMC 9332BDT 21140A [10-100Mb/s] pass 2.0 de0: address 00:00:c0:1e:03:f2 pci0: at device 12.0 (no driver attached) orm0: