Date: Fri, 6 Feb 2015 12:07:01 +0800 From: Peter Xu <xzpeter@gmail.com> To: "Kenneth D. Merry" <ken@freebsd.org> Cc: freebsd-scsi@freebsd.org Subject: Re: bugfix: SA driver will unwind when close device even with SA_MODE_NOREWIND Message-ID: <CAGRNztA-30KopPju1vKiKD5YTrdnKGLhaPQYH2xKowO=NkLeeA@mail.gmail.com> In-Reply-To: <20150205223826.GA16679@mithlond.kdm.org> References: <CAGRNztBwR1vz=by8SVgG_fNx%2B1RRogEjT4VueDDbXjjD1PrtdA@mail.gmail.com> <20150205223826.GA16679@mithlond.kdm.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <ken@freebsd.org> 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 >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGRNztA-30KopPju1vKiKD5YTrdnKGLhaPQYH2xKowO=NkLeeA>