From owner-freebsd-bugs@FreeBSD.ORG Tue Sep 9 19:10:16 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A046316A4BF for ; Tue, 9 Sep 2003 19:10:16 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7221D43FF5 for ; Tue, 9 Sep 2003 19:10:14 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h8A2AEUp018745 for ; Tue, 9 Sep 2003 19:10:14 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h8A2AEZU018744; Tue, 9 Sep 2003 19:10:14 -0700 (PDT) Resent-Date: Tue, 9 Sep 2003 19:10:14 -0700 (PDT) Resent-Message-Id: <200309100210.h8A2AEZU018744@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jeremy McMillan Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8638116A4BF for ; Tue, 9 Sep 2003 19:02:07 -0700 (PDT) Received: from horizon.aphor.net (dsl081-142-094.chi1.dsl.speakeasy.net [64.81.142.94]) by mx1.FreeBSD.org (Postfix) with ESMTP id A9A7043FE0 for ; Tue, 9 Sep 2003 19:02:06 -0700 (PDT) (envelope-from aphor@horizon.aphor.net) Received: from horizon.aphor.net (localhost [127.0.0.1]) by horizon.aphor.net (8.12.6p2/8.12.6) with ESMTP id h8A225T4068597 for ; Tue, 9 Sep 2003 21:02:05 -0500 (CDT) (envelope-from aphor@horizon.aphor.net) Received: (from aphor@localhost) by horizon.aphor.net (8.12.6p2/8.12.6/Submit) id h8A225CK068596; Tue, 9 Sep 2003 21:02:05 -0500 (CDT) Message-Id: <200309100202.h8A225CK068596@horizon.aphor.net> Date: Tue, 9 Sep 2003 21:02:05 -0500 (CDT) From: Jeremy McMillan To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/56664: bad file# in MTIO status buffer after MTEOD until MTREW X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Jeremy McMillan List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Sep 2003 02:10:16 -0000 >Number: 56664 >Category: kern >Synopsis: bad file# in MTIO status buffer after MTEOD until MTREW >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Sep 09 19:10:13 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Jeremy McMillan >Release: FreeBSD 4.8-RC i386 >Organization: >Environment: System: FreeBSD horizon.aphor.net 4.8-RC FreeBSD 4.8-RC #1: Tue Mar 4 21:42:48 CST 2003 root@nell.notrecords.com:/obj/usr/usr/src/sys/SD11K7 i386 sa0 at ahc0 bus 0 target 4 lun 0 sa0: Removable Sequential Access SCSI-2 device sa0: 20.000MB/s transfers (10.000MHz, offset 8, 16bit) >Description: MTIO fails to report the actual file and record position in mtget.mt_fileno after executing the MTEOD command. Breaks bacula port. >How-To-Repeat: Rewind your DLTIV tape. use this C program to inspect the tape IO status buffer of the /dev/nrsa0 (asuming you have only a single DLTIV tape drive) after using mt(1) to 'fsf' and 'bsf' around from file to file on your tape. Then use mt(1) to 'eod' and see where the status buffer says you are. You can 'fsf' and 'bsf' around, but the status buffer reports file number -1 and block number -1 until you rewind. ---cut--- /* mtstat: print the contents of the mtget struct for human eyes after getting status from a device */ #include sys/mtio.h #include fcntl.h #include stdio.h #include stdlib.h void st_status (struct mtget); int main(int argc,char *argv[]) { int mtfd; char *tape; struct mtget mt_status; if (argc!=2) {printf("Usage:\n\t%s /dev/nrsa#\n",argv[0]);exit(1);} else { tape = argv[1]; if ((mtfd = open(tape, O_RDONLY)) < 0) err(1, "%s", tape); if (ioctl(mtfd, MTIOCGET, &mt_status) < 0) err(1, NULL); printf( "%s location:\tFile=%d\tBlock=%d\n", tape, (int)mt_status.mt_fileno, (int)mt_status.mt_blkno ); } exit(0); } ---cut--- >Fix: >Release-Note: >Audit-Trail: >Unformatted: