From owner-freebsd-scsi@FreeBSD.ORG Fri Feb 6 04:07:02 2015 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34454CD5; Fri, 6 Feb 2015 04:07:02 +0000 (UTC) Received: from mail-ig0-x232.google.com (mail-ig0-x232.google.com [IPv6:2607:f8b0:4001:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDDC5DEF; Fri, 6 Feb 2015 04:07:01 +0000 (UTC) Received: by mail-ig0-f178.google.com with SMTP id hl2so5100371igb.5; Thu, 05 Feb 2015 20:07:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=LTT8uzuXqmS25ZAYfeBW3Pya6lb/PxJMYZ7Zy+zS5Ow=; b=YUC5FiGch91YQ01zOzt4jL9eVUNCsqSh28K6iwTvbqfdgTaIomjsqjVNWgW8+W9LvK sAePNke0y9yX9XaHv02E5x7PHS0uUx5jr6GDgmPZAKZ9ceALYZR/7yYoKF9+qY24q45P qLEDnP9KOgzMSyS/44ut1sCie75/YH3T3a5H6QsvZNbDZN4kgrEXSw89kDG1rtmU1U+j SxxijY2odkCrQHXlZTq7iPWBS87ZUHMsovgv3mS91chYUhPABzwrQF4/9sIQwzef6DG/ gzNTr7KhAl5b46PczSRggo4UIbI1pgFUKwE2mLrAoTJ2ZJUUtpHctA4OyhkPqLi1hZCG esVg== MIME-Version: 1.0 X-Received: by 10.50.253.12 with SMTP id zw12mr304984igc.24.1423195621394; Thu, 05 Feb 2015 20:07:01 -0800 (PST) Received: by 10.107.53.77 with HTTP; Thu, 5 Feb 2015 20:07:01 -0800 (PST) In-Reply-To: <20150205223826.GA16679@mithlond.kdm.org> References: <20150205223826.GA16679@mithlond.kdm.org> Date: Fri, 6 Feb 2015 12:07:01 +0800 Message-ID: Subject: Re: bugfix: SA driver will unwind when close device even with SA_MODE_NOREWIND From: Peter Xu To: "Kenneth D. Merry" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: freebsd-scsi@freebsd.org X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2015 04:07:02 -0000 I think I was misguided by the source code. In saregister() of scsi_sa.c, it might be confusing that the loop to create the .[0-3] devices are using SA_NUM_MODES: for (i = 0; i < SA_NUM_MODES; i++) { Thanks for the clarify. :) Peter On Fri, Feb 6, 2015 at 6:38 AM, Kenneth D. Merry wrote: > On Fri, Jan 30, 2015 at 13:55:17 +0800, Peter Xu wrote: > > Hi, > > > > In BSD system, when tape devices are discovered, CAM will create specific > > /dev/saX.[0-3] automatically. Here when we does not the tape to auto > rewind > > when closing the device, we should access /dev/saX.1 (which means we are > > using SA_MODE_NOREWIND mode). > > > > Found one bug that tape will auto rewind even accessing /dev/saX.1. > > That isn't a bug, it is the way things are supposed to work. The minor > device terminology in the man page may be a little confusing. > > The man page says: > > FILES > /dev/[n][e]sa[0-9] general form: > /dev/sa0 Rewind on close > /dev/nsa0 No rewind on close > /dev/esa0 Eject on close (if capable) > /dev/sa0.ctl Control mode device (to examine state while > another > program is accessing the device, e.g.). > > The naming convention carries over to the /dev/[n][e]sa[0-9].[0-3] devices. > > If you want a non-rewound device, you would need to use /dev/nsaX, or > /dev/nsaX.[0-3]. If you want the tape to be ejected, you would use the > /dev/esaX.[0-3] device. > > The idea behind the .[0-3] devices was that they were to be for different > possible tape drive densities. If you look at the output of 'mt status', > it has output entries that could be filled with possible densities, but > that aren't actually used. > > Just as the entries in 'mt status' aren't used, the .[0-3] entries are not > used. There is no difference between those entries and the standard device > names. > > I've considered removing the .[0-3] entries, since they are primarily just > confusing for anyone who sees them. If anyone thinks we should keep them, > let me know. Otherwise I may just take them out with the upcoming round of > sa(4) driver changes. > > There are modern tape drives (e.g. IBM TS1140, TS1150) that are capable > of writing at multiple densities, but I don't know that we need to > necessarily let the user switch density by using a different device. > You can also do a 'mt density X' and switch that way. > > Ken > -- > Kenneth Merry > ken@FreeBSD.ORG >