summaryrefslogtreecommitdiff
path: root/sys/scsi/st.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/st.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/st.c')
-rw-r--r--sys/scsi/st.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/scsi/st.c b/sys/scsi/st.c
index 3522b64d4b5..203b5e24631 100644
--- a/sys/scsi/st.c
+++ b/sys/scsi/st.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: st.c,v 1.95 2010/06/01 15:27:16 thib Exp $ */
+/* $OpenBSD: st.c,v 1.96 2010/06/11 12:02:44 krw Exp $ */
/* $NetBSD: st.c,v 1.71 1997/02/21 23:03:49 thorpej Exp $ */
/*
@@ -1083,7 +1083,7 @@ st_buf_done(struct scsi_xfer *xs)
{
struct st_softc *st = xs->sc_link->device_softc;
struct buf *bp = xs->cookie;
- int s;
+ int error, s;
switch (xs->error) {
case XS_NOERROR:
@@ -1101,7 +1101,13 @@ st_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;