summaryrefslogtreecommitdiff
path: root/sys/scsi/sd.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2010-06-11 12:02:45 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2010-06-11 12:02:45 +0000
commit35c47ac69946b4f4f8b51f9723733f8f8a19518a (patch)
tree9792554c9b6d5168dc8cf5a245f4e72cf59cd4b7 /sys/scsi/sd.c
parentbd69be7a587df5862cb59d681c1e6f082868569d (diff)
Restore an unusual XS_SENSE semantic that inadvertantly got lost
in the great re-write. If the scsi device *_interpret_sense() function returns 0 that means there was no error. Fixes restore(8) problems seen on certain tape drives. Found and fix tested by Percey Piper. Suggestions from Matthew Dempsky. Thanks! ok dlg@
Diffstat (limited to 'sys/scsi/sd.c')
-rw-r--r--sys/scsi/sd.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index 0c72b47ccbf..4bb4df1d0a7 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.192 2010/06/02 13:32:13 dlg Exp $ */
+/* $OpenBSD: sd.c,v 1.193 2010/06/11 12:02:44 krw Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -729,7 +729,7 @@ sd_buf_done(struct scsi_xfer *xs)
{
struct sd_softc *sc = xs->sc_link->device_softc;
struct buf *bp = xs->cookie;
- int s;
+ int error, s;
switch (xs->error) {
case XS_NOERROR:
@@ -749,7 +749,13 @@ sd_buf_done(struct scsi_xfer *xs)
case XS_SENSE:
case XS_SHORTSENSE:
- if (scsi_interpret_sense(xs) != ERESTART)
+ error = scsi_interpret_sense(xs);
+ if (error == 0) {
+ bp->b_error = 0;
+ bp->b_resid = xs->resid;
+ break;
+ }
+ if (error != ERESTART)
xs->retries = 0;
goto retry;