From owner-freebsd-scsi@FreeBSD.ORG Wed May 14 15:54:16 2003 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F002237B401 for ; Wed, 14 May 2003 15:54:16 -0700 (PDT) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 34B4943F3F for ; Wed, 14 May 2003 15:54:16 -0700 (PDT) (envelope-from nate@rootlabs.com) Received: (qmail 79406 invoked by uid 1000); 14 May 2003 22:54:17 -0000 Date: Wed, 14 May 2003 15:54:17 -0700 (PDT) From: Nate Lawson To: Dan Langille , Kern Sibbald In-Reply-To: <3EBFC194.23070.5D6681F1@localhost> Message-ID: <20030514155057.R79399@root.org> References: <3EBFC194.23070.5D6681F1@localhost> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-scsi@freebsd.org Subject: Re: do we have MTIOCLRERR on ioctl? X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2003 22:54:17 -0000 On Mon, 12 May 2003, Dan Langille wrote: > ------- Forwarded message follows ------- > From: Kern Sibbald > > PS: Just to amplify a bit: When Bacula gets an EOM, > it immediately writes two EOF marks. One would be > sufficient, but this way I am sure that the tape > is terminated for ALL drives. It then does > two backspace files followed by a backspace > record, if that succeeds, it re-reads the last > record and compares the CRC and block number with > what it wrote and reports success or failure. > > On FreeBSD (at least your case), it was the backspace > record that failed as is the case on a certain number > of tape drives. However, what was unusual was that > it "froze" the tape. Bacula then does an ioctl() > MTIOCLRERR on all systems that support it -- hoping > to clear the error condition. I'm not very familiar with tape drives but I think what you want is MTIOCERRSTAT. It reads the current error condition and then zeros it (see /sys/cam/scsi/scsi_sa.c). Try using that for Bacula on FreeBSD. -Nate