summaryrefslogtreecommitdiff
path: root/sys/scsi/sd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/scsi/sd.c')
-rw-r--r--sys/scsi/sd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index 405e3b111e3..35ee5bfcf79 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.174 2010/01/04 00:45:58 dlg Exp $ */
+/* $OpenBSD: sd.c,v 1.175 2010/01/05 01:21:34 dlg Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -782,9 +782,6 @@ sd_buf_done(struct scsi_xfer *xs)
splassert(IPL_BIO);
- disk_unbusy(&sc->sc_dk, bp->b_bcount - xs->resid,
- bp->b_flags & B_READ);
-
switch (xs->error) {
case XS_NOERROR:
bp->b_error = 0;
@@ -793,6 +790,8 @@ sd_buf_done(struct scsi_xfer *xs)
case XS_NO_CCB:
/* The adapter is busy, requeue the buf and try it later. */
+ disk_unbusy(&sc->sc_dk, bp->b_bcount - xs->resid,
+ bp->b_flags & B_READ);
sd_buf_requeue(sc, bp);
scsi_xs_put(xs);
SET(sc->flags, SDF_WAITING); /* break out of sdstart loop */
@@ -820,6 +819,9 @@ sd_buf_done(struct scsi_xfer *xs)
break;
}
+ disk_unbusy(&sc->sc_dk, bp->b_bcount - xs->resid,
+ bp->b_flags & B_READ);
+
biodone(bp);
scsi_xs_put(xs);
sdstart(sc); /* restart io */