From owner-freebsd-scsi@FreeBSD.ORG Mon Dec 19 19:12:11 2005 Return-Path: X-Original-To: freebsd-scsi@freebsd.org 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 09E4A16A41F for ; Mon, 19 Dec 2005 19:12:11 +0000 (GMT) (envelope-from lydianconcepts@gmail.com) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.200]) by mx1.FreeBSD.org (Postfix) with ESMTP id 41E1C43D45 for ; Mon, 19 Dec 2005 19:12:10 +0000 (GMT) (envelope-from lydianconcepts@gmail.com) Received: by wproxy.gmail.com with SMTP id 70so1109984wra for ; Mon, 19 Dec 2005 11:12:09 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=gkCRCo0fcMatrmdEhWKvPwM/Zzz7/20rHfUJ5OYPLhC9aEUWsitGZOwsHTVnksk212eDJUhGGAFd/5n3t+OBJKnilISlvUyj3wHoF9QZwiLY20idrcLVnSjqaAYLpbtqXaCA8jDgi+fz7TGtNEdzhQl91Xd4qMs0ik/vAOKy2Ms= Received: by 10.65.141.7 with SMTP id t7mr5636495qbn; Mon, 19 Dec 2005 11:12:09 -0800 (PST) Received: by 10.65.155.20 with HTTP; Mon, 19 Dec 2005 11:12:09 -0800 (PST) Message-ID: <7579f7fb0512191112n3a5d8a5ai6e27587a39c7023b@mail.gmail.com> Date: Mon, 19 Dec 2005 14:12:09 -0500 From: Matthew Jacob To: Kern Sibbald In-Reply-To: <200512191034.52756.kern@sibbald.com> MIME-Version: 1.0 References: <200512151122.34949.kern@sibbald.com> <7579f7fb0512181448x1dc4b3f4m9d5112cc6bc9fc1a@mail.gmail.com> <200512191034.52756.kern@sibbald.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-scsi@freebsd.org Subject: Re: Tape drive handling on FreeBSD X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2005 19:12:11 -0000 On 12/19/05, Kern Sibbald wrote: > On Sunday 18 December 2005 23:48, Matthew Jacob wrote: > > The first paragraph of mtio(4) describes the usage of a control device. > > Yes, thanks. I've already read that and other sections of the man pages, > and > it is true that the .ctl device allows one to figure out if a tape drive > really exists or not. The problem is: > > 1. It is system dependent -- I would like to see some standardization of > the > Unix API from system to system where it is reasonable, practical, and > doesn't > break everything. ..... My problem is that if I change the FreeBSD API, it breaks current usage. Otherwise, there is no true tape device API in Unix. Look at any existing backup package that is multi-platform. It breaks each platform into different vectors that abstract the differences. Don't get me wrong- I'm not promoting that there should differences. I'm observing that nearly thirty years of Unix shows that there are and that th= e way that those differences have been handled successfully by dozens of tape backup packages (albeit with grumbling). > 2. The errno that is currently returned by an empt tape drive during an > open() > is "incorrect" or at the least misleading. The value that Solaris returns (EIO) for trying to open a tape (!O_NONBLOCK= ) when no tape is loaded (i.e., fails TUR) is no less misleading. Your complaint here is that ERRNO is not sufficient. It isn't. > 3. The API that you currently have doesn't work correctly with Bacula, > which > was originally designed on Linux and Solaris -- it penalizes FreeBSD > Bacula > users. Since the FreeBSD way of doing things is the minority in my littl= e > Unix world, it is unlikely (though possible) that I will rewrite my code. Well, that is your privilege. > 4. There are other shortcomings of the SCSI driver that penalize FreeBSD > users > compared to Solaris and Linux that I would like to discuss as well > (ability > to have the driver efficiently space to the end of the medium and keep > track > of the file position). Despite the fact that I'm the nominal maintainer, I probably won't do that much more. I put in a fair amount of time some years back, spent around 7500$ of my own personal money to buy tape drives to do testing with. That said, the return value for this was more than what I got for writing the Solaris tape driver (which is shockingly and pathetically bad, but has also remained relatively unchanged for over 10 years). Still, the things that penalize FreeBSD are many- the tape driver is hardly a leading candidate. > Actually, I am really shocked how poor the "Unix" tape interface is (this > has > nothing to do with FreeBSD in particular). There is no standard way to se= t > tape drive options, there is no standard way to figure out if a tape driv= e > exists and what options it has set for it (blocking, two eof, density, > compression, ...). Probably most annoying, there is no standard way to > know > if a tape is mounted or not. Yes. > My main interest is to try to discuss what possibilities exist for > changing > (unifying) the API (or there is also a small chance that I am missing > something ...). If no possibility of discussion/changes exists, so be it= . a) If you can get a consensus amongs more FreeBSD tape clients than you tha= t there *should* be convergence to, e.g., Linux, or Solaris, I certainly woul= d be interested. Get the Amanda and Arkeia folks on board, and we might be able to get enough consensus to override the concerns of people even more conservative than I am. b) If you rewrite Bacula to actually be more platform independent you might serve yourself better. Having maintained some of the nsrmmd code for NetWorker/Legato, I *am* sympathetic to your concerns here. However, the other thing I've learned, very very very very painfully, is that making changes to existing tape interfaces (no matter how broken) will almost certainly enrage and break more than it fixes as everyone who uses said interfaces usually is caught by surprise when things change. I suppose that we could have a separate SA device entry point that mandated different tape semantics- that might help minimize breakage at the risk of complexity. Part of the problem is that you probably are asking for a different state machine in the driver as well. Look- dialogue is good, but temper it with some realities please.