summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2010-09-01 23:24:04 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2010-09-01 23:24:04 +0000
commit1a34d6aa784d2a157d6bc04ff7448e0648ec180d (patch)
tree2849382d5c7e4bd442e7240ff9e6f38b356a84c9
parent48b3c52d7d38c9e2f82321d22c4a0e0fbca46c98 (diff)
Don't give xs->resid an invalid value (xs->datalen * st->blksize)
inside st_interpret_sense() and then exit without making sure it's set back to <= xs->datalen. Fixes 'done < 0; strategy broken' panics when un-tar'ing /cvs from my ahci DAT tape drive. ok dlg@ more-or-less-ok matthew@
-rw-r--r--sys/scsi/st.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/scsi/st.c b/sys/scsi/st.c
index 56556e69fb9..356c81ea548 100644
--- a/sys/scsi/st.c
+++ b/sys/scsi/st.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: st.c,v 1.108 2010/09/01 01:38:12 dlg Exp $ */
+/* $OpenBSD: st.c,v 1.109 2010/09/01 23:24:03 krw Exp $ */
/* $NetBSD: st.c,v 1.71 1997/02/21 23:03:49 thorpej Exp $ */
/*
@@ -2036,6 +2036,7 @@ st_interpret_sense(struct scsi_xfer *xs)
* If no data was transferred, return immediately
*/
if (xs->resid >= xs->datalen) {
+ xs->resid = xs->datalen;
if (st->flags & ST_EIO_PENDING)
return EIO;
if (st->flags & ST_AT_FILEMARK) {