From owner-freebsd-scsi@FreeBSD.ORG Thu Feb 5 22:38:29 2015 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03EAC765 for ; Thu, 5 Feb 2015 22:38:29 +0000 (UTC) Received: from mithlond.kdm.org (mithlond.kdm.org [70.56.43.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "A1-33714", Issuer "A1-33714" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E583925 for ; Thu, 5 Feb 2015 22:38:28 +0000 (UTC) Received: from mithlond.kdm.org (localhost [127.0.0.1]) by mithlond.kdm.org (8.14.9/8.14.9) with ESMTP id t15McQYb016841 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 5 Feb 2015 15:38:26 -0700 (MST) (envelope-from ken@mithlond.kdm.org) Received: (from ken@localhost) by mithlond.kdm.org (8.14.9/8.14.9/Submit) id t15McQaR016840; Thu, 5 Feb 2015 15:38:26 -0700 (MST) (envelope-from ken) Date: Thu, 5 Feb 2015 15:38:26 -0700 From: "Kenneth D. Merry" To: Peter Xu Subject: Re: bugfix: SA driver will unwind when close device even with SA_MODE_NOREWIND Message-ID: <20150205223826.GA16679@mithlond.kdm.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (mithlond.kdm.org [127.0.0.1]); Thu, 05 Feb 2015 15:38:26 -0700 (MST) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS autolearn=ham autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mithlond.kdm.org 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: Thu, 05 Feb 2015 22:38:29 -0000 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