freebsd-nq/sys/cam
Joerg Wunsch fc89704c57 Fix the `tape drive spinning indefinately upon mt stat' problem.
With the recent changes in the CAM error handling, some problems in
the error handling of sa(4) have been uncovered.  Basically, a number
of conditions that are not actually errors have been mistreated as
genuine errors.  In particular:

. Trying to read in variable length mode with a mismatched blocksize
  between the on-tape (virtual) blocks and the read(2) supplied buffer
  size, causing an ILI SCSI condition, have caused an attempt to retry
  the supposedly `errored' transfer, causing the tape to be read
  continuously until it eventually hit EOM.  Since by default any
  simple mt(1) operation does an initial test read, an `mt stat' was
  sufficient to trigger this bug.

  Note that it's Justin's opinion that treating a NO SENSE as an EIO
  is another bug in CAM.  I feel not authorized to fix cam_periph.c
  without another confirmation that i'm on the right track, however.

. Hitting a filemark caused the read(2) syscall to return EIO, instead
  of returning a `short read'.  Note that the current fix only solves
  this problem in variable length mode.  Fixed length mode uses a
  different code path, and since i didn't grok all the intentions behind
  that handling, i did not touch it (IOW: it's still broken, and you get
  an EIO upon hitting a filemark).

The solution is to keep track of those conditions inside saerror(),
and upon completion to not call cam_periph_error() in that case.  We
need to make sure that the device gets unfrozen if needed though (in
case of actual errors, cam_periph_error() does this on our behalf).

Not objected by:       mjacob (who currently doesn't have the time to
			      review the patch)
2001-04-22 20:13:28 +00:00
..
scsi Fix the `tape drive spinning indefinately upon mt stat' problem. 2001-04-22 20:13:28 +00:00
cam_ccb.h Rewrite of the CAM error recovery code. 2001-03-27 05:45:52 +00:00
cam_debug.h Rewrite of the CAM error recovery code. 2001-03-27 05:45:52 +00:00
cam_extend.c Remove unneeded #include <sys/kernel.h> 2000-04-29 15:36:14 +00:00
cam_extend.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
cam_periph.c Fix an off-by-2 error in periphdriver_register(). The read side of the 2001-04-16 15:53:54 +00:00
cam_periph.h Change the peripheral driver list from a linker set to module driven 2001-02-07 07:05:59 +00:00
cam_queue.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
cam_queue.h Back out the previous change to the queue(3) interface. 2000-05-26 02:09:24 +00:00
cam_sim.c Const'ify cam_sim.sim_name to quiet warnings. 2001-01-24 01:46:18 +00:00
cam_sim.h Const'ify cam_sim.sim_name to quiet warnings. 2001-01-24 01:46:18 +00:00
cam_xpt_periph.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
cam_xpt_sim.h Clean up the xpt_sim creation to mirror how HBA drivers perform this task. 2000-01-14 23:08:46 +00:00
cam_xpt.c Rewrite of the CAM error recovery code. 2001-03-27 05:45:52 +00:00
cam_xpt.h Rewrite of the CAM error recovery code. 2001-03-27 05:45:52 +00:00
cam.c Rewrite of the CAM error recovery code. 2001-03-27 05:45:52 +00:00
cam.h comment typo: subsytem -> subsystem 2001-03-31 04:34:15 +00:00