opened norewind and 2 filemarks are written at the end a phantom file
is left (just what I was afraid of, but I didn't think about it in
the last delta because somehow I had managed to convince myself that
this was a nonissue. It's not.).
So- in stdone clear ST_WRITTEN for regular reads. In st_close, preserve
the state of ST_WRITTEN, and if no error and 2FM@EOD for this device and
this is a no-rewind open, backspace one filemark. This should preserve
(for this mount session) FILE - FMK - FILE - FMK - FILE ... FILE FMK FMK EOD
sequencing.
This doesn't clean up the case of EOM appends- in this case you *will* still
get (after an MTEOM operation and a write of a file) a phantom empty file,
e.g. FILE - FMK FMK - FILE - FMK FMK EOD *unless* you follow the EOM operation
with an explicit backspace. The trouble is that this makes it difficult for
seamless interchange with other systems which don't necessarily follow.
The preferrable alternative would be to eliminate the 2FM@EOD except for
1/2" Reel tapes, but that has been pretty much nixed within developers.
-store printable product ID in cd's and sd's softc, use it as "typename"
-for this, add a "destination buffer length" argument to scsipi_strvis()
-return ATAPI device type for ATAPI devices
filemark 'coz you opened write only and didn't do anything else,
call st_check_eod to possibly write TWO furshlugginer filemarks.
Also- return any errors from writing filemarks out of stclose.
like a no-rewind device. Secondly figure out whether the initial TUR
for a CTRL_MODE open resulted in a tape being actually found (if so,
then do a mount session).
Move the 'sun compatibility' behaviour into stdone && stclose- don't
mark a tape as having been written in stopenm, fer gosh sakes.
Also- to be fair and on review, kern/391 isn't really addressed by
the previous commits. In reviewing, I'm embarassed to find that this
talks about reading at EOT. I'm actually going to claim that this
is 'not a bug' or 'fixed already' in that at the end of media (at the
edge of recorded media), you may continuously open the tape (should
you choose to) issue a read, and zero bytes will transfer- this is a
sufficient EOF indicator.
a now unused variable. Also, remove the restriction against at density
code being greater than the max SCSI 2 density code: 0x80..0xff are the
Vendor Unique codes and most certainly should be allowed. The check for
invalid values should be less than 0 or greater than 255.
Oh- yeah, the previous commit addressed kern/391.
EOM_PENDING. Set up a persistent EARLYWARNING behaviour flag. If
set, EOM behaviour forces a 'short read' to signal logical (as
opposed to physical) end of media. The user application may, of
course, do with this information what it will.
The EARLYWARNING behaviour may be enabled/disabled by a MTIOCTOP
operation. The default action is to not have EARLYWARNING enabled-
but this may be reversed by an option ST_ENABLE_EARLYWARN in
the kernel build.
("CTLMODE") subdevice. There are legitimate uses for raw commands with
normal tape handles too.
[I'm not sure if this is a final solution. Administrators might want
to set up a more finegrained policy. However, this should not be mixed
with the "set defaults" semantics of the "CTLMODE" subdevice; another
flag should be used instead (eg execute permission or a minor number bit).]
data ASC/ASCQ of 0x04/0x01 (logical unit not ready, initialization in progress),
hang out for 5 seconds and return a RETRY THE OPERATION command. If we
get a check condition/sense data ASC/ASCQ of 0x04/0x02 (logical unit not
ready, initialization command required), send a polled/nosleep START UNIT
command and return a RETRY THE OPERATION command if that succeeds.
Don't send a START UNIT to a disk quirked as SDEV_NO_START. Don't send
a START UNIT to removable media. The reason for the latter is to not
just blindly spin up new (maybe changed) media.
I should note that I've successfully made this work with the ISP host
adapter so far. Other host adapters will need some work to be able
to manage or reasonably fail NOSLEEP/POLL commands while in this
state. Alternatively, the internal SCSI midlayer structure has got
to allow for more controlled error recovery (e.g., restart queues
controlled by the target driver).
drivers' sense handlers to return. Coincidentally one of them ends up
being ERESTARTSYS.
2) Add a SCSI_URGENT flag to xs structure- this allows host adapters that
do command tagging to do the right thing wrt a tag.
1) Quirk entries for Storage Tek 9490 (Timberline) and D3 (Redwood)
drives.
2) Modification to st_loadtape to do a REWIND to BOT if the
action is a load and the tape doesn't support the LOAD command
(9490, SD3, and IBM 3590).
3) Cleaned up the 'undersized user record' error message to
make a little more sense.
Various bug fixes:
kern/1275: Now returns values in dsreg and erreg and sets resid
(as best as it can for a 16 but integer). See also
a recent change to mtio.h. We are declining to fix
the portion of this bug about naming a more specific
SCSI device. Since there is nothing programmatic
you can do with that information, it is not useful
to pass back at this time.
A side effect of this change is that doing MTIOCGET
also forces a mode sense (to get the current state
of WRITE PROTECT).
kern/5647: Now no longer logs to the console ILI or Filemark or (first)
EOM (on write) errors (unless SCSIDEBUG is set).
kern/5525: Substantially increased timeouts for a variety of
operations, and split them into categories of
I/O, Space, and Control operations (each have
likely different inherent times). I/O is for
reads/writes. Control is for mode sense/select.
Space is for spacing the tape.
Until EOM handling is changed, though kern/391 is still not fixed. A side
effect of EOM handling is that you now always 'lose' (to the writing
application's view) the last write since EIO is what is returned on
EOM detection during writes. Hopefully the reader applications don't
get too bent out of shape by this.
takes to do IELEM can be proportional to the number of elements, but is
also affected by wierd things like how readable the barcodes on the
media are. There are worst case scenarios I've seen where there are
white labels on the back of tapes with pencilled in labels which is
*just* close enough to being a bar code that an Exabyte 120 would
peer at them myopically and long enough for a *really* long time to
pass in inventorying the jukebox.
I've upped the limit to be proportional to 5 minutes per element. That
is long enough that someone I'm sure will complain about "you wait
to long and should time out" for broken h/w.
As is also noted in the PR, there are a lot of other issues here. It's
really also a question as to whether to update this driver or go
with CAM's driver. This one doesn't have switching between block
descriptors and not, doesn't support volume tag setting, and so on.
Time is limited. This PR should have been closed and fixed right away,
tho.
as with user-land programs, include files are installed by each directory
in the tree that has includes to install. (This allows more flexibility
as to what gets installed, makes 'partial installs' easier, and gives us
more options as to which machines' includes get installed at any given
time.) The old SYS_INCLUDES={symlinks,copies} behaviours are _both_
still supported, though at least one bug in the 'symlinks' case is
fixed by this change. Include files can't be build before installation,
so directories that have includes as targets (e.g. dev/pci) have to move
those targets into a different Makefile.
operation with address 0 length 0, which, according to the SCSI-2 spec, should
be interpreted as "synchronize all remaining blocks beginning at address 0".