freebsd-nq/sys/cam
Kenneth D. Merry 60a899a075 Fix a bug in the error recovery code. It was possible to have more than
one error recovery action oustanding for a given peripheral.

This is bad for several reasons.  The first problem is that the error
recovery actions would likely be to fix the same problem.  (e.g., we
queue 5 CCBs to a disk, and the first one comes back with 0x04,0x02.  We
start error recovery, and the second one comes back with the same status.
Then the third one comes back, and so on.  Each one causes the drive to get
nailed with a start unit, when we really only need one.)

The other problem is that we only have space to store one CCB while we're
doing error recovery.  The subsequent error recovery actions that got
started were over-writing the CCBs from previous error recovery actions,
but we still tried to call the done routine N times for N error recovery
actions.  Each call to dadone() was done with the same CCB, though.  So on
the second one, we got a "biodone: buffer not busy" panic, since the buffer
in question had already been through biodone().

In any case, this fixes things so that any any given time, there's only one
error recovery action outstanding for any given peripheral driver.

Reviewed by:	gibbs
Reported by:	Philippe Regnauld <regnauld@deepo.prosa.dk>
[ Philippe wins the "bug finder of the week" award ]
1998-10-13 21:41:32 +00:00
..
scsi Fixed two potentially serious classes of bugs: 1998-10-13 08:24:45 +00:00
cam_ccb.h CAM Transport Layer (XPT). 1998-09-15 06:33:23 +00:00
cam_conf.h CAM Transport Layer (XPT). 1998-09-15 06:33:23 +00:00
cam_debug.h Add a new CAM debugging mode, CAM_DEBUG_CDB. This causes the kernel to 1998-10-02 21:00:58 +00:00
cam_extend.c CAM Transport Layer (XPT). 1998-09-15 06:33:23 +00:00
cam_extend.h CAM Transport Layer (XPT). 1998-09-15 06:33:23 +00:00
cam_periph.c Fix a bug in the error recovery code. It was possible to have more than 1998-10-13 21:41:32 +00:00
cam_periph.h Fix a bug in the error recovery code. It was possible to have more than 1998-10-13 21:41:32 +00:00
cam_queue.c CAM Transport Layer (XPT). 1998-09-15 06:33:23 +00:00
cam_queue.h CAM Transport Layer (XPT). 1998-09-15 06:33:23 +00:00
cam_sim.c CAM Transport Layer (XPT). 1998-09-15 06:33:23 +00:00
cam_sim.h CAM Transport Layer (XPT). 1998-09-15 06:33:23 +00:00
cam_xpt_periph.h CAM Transport Layer (XPT). 1998-09-15 06:33:23 +00:00
cam_xpt_sim.h CAM Transport Layer (XPT). 1998-09-15 06:33:23 +00:00
cam_xpt.c Fix a bug in the scan lun code that showed up when we did the following 1998-10-13 21:29:04 +00:00
cam_xpt.h CAM Transport Layer (XPT). 1998-09-15 06:33:23 +00:00
cam.c cam.c: 1998-09-22 04:53:23 +00:00
cam.h CAM Transport Layer (XPT). 1998-09-15 06:33:23 +00:00