Fixed the bug that caused negative busycounts in devstat. The

devstart_start_transaction() call is misplaced - it is after the
wdustart() call that queues the transaction on the controller queue.
Normally this doesn't matter because we're running at splbio() so
nothing will look at the controller queue.  However, obsolescent
code for syncing labels sometimes slept after the transaction was
started, so the transaction sometimes completed before it was
[recorded as] started.  This code was misplaced even for syncing
labels.  Move it to the right place.  It should go away, but
something may depend on its side effects.
This commit is contained in:
Bruce Evans 1998-11-15 13:54:31 +00:00
parent d5f87f1a87
commit 4cfe0f4600

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)wd.c 7.2 (Berkeley) 5/9/91
* $Id: wd.c,v 1.177 1998/10/13 08:24:39 dg Exp $
* $Id: wd.c,v 1.178 1998/10/22 05:58:41 bde Exp $
*/
/* TODO:
@ -664,17 +664,17 @@ wdstrategy(register struct buf *bp)
/* queue transfer on drive, activate drive and controller if idle */
s = splbio();
bufqdisksort(&drive_queue[lunit], bp);
if (wdutab[lunit].b_active == 0)
wdustart(du); /* start drive */
/* Pick up changes made by readdisklabel(). */
if (du->dk_flags & DKFL_LABELLING && du->dk_state > RECAL) {
wdsleep(du->dk_ctrlr, "wdlab");
du->dk_state = WANTOPEN;
}
bufqdisksort(&drive_queue[lunit], bp);
if (wdutab[lunit].b_active == 0)
wdustart(du); /* start drive */
#ifdef CMD640
if (wdtab[du->dk_ctrlr_cmd640].b_active == 0)
#else