summaryrefslogtreecommitdiff
path: root/sys/scsi/st.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/scsi/st.c')
-rw-r--r--sys/scsi/st.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/scsi/st.c b/sys/scsi/st.c
index 3f88efd1c58..0335175bd03 100644
--- a/sys/scsi/st.c
+++ b/sys/scsi/st.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: st.c,v 1.134 2017/09/08 05:36:53 deraadt Exp $ */
+/* $OpenBSD: st.c,v 1.135 2019/01/20 03:28:19 krw Exp $ */
/* $NetBSD: st.c,v 1.71 1997/02/21 23:03:49 thorpej Exp $ */
/*
@@ -883,7 +883,7 @@ ststrategy(struct buf *bp)
device_unref(&st->sc_dev);
return;
bad:
- bp->b_flags |= B_ERROR;
+ SET(bp->b_flags, B_ERROR);
done:
/* Set b_resid to indicate no xfer was done. */
bp->b_resid = bp->b_bcount;
@@ -948,7 +948,7 @@ ststart(struct scsi_xfer *xs)
* Back up over filemark
*/
if (st_space(st, 0, SP_FILEMARKS, 0)) {
- bp->b_flags |= B_ERROR;
+ SET(bp->b_flags, B_ERROR);
bp->b_resid = bp->b_bcount;
bp->b_error = EIO;
s = splbio();
@@ -959,7 +959,7 @@ ststart(struct scsi_xfer *xs)
} else {
bp->b_resid = bp->b_bcount;
bp->b_error = 0;
- bp->b_flags &= ~B_ERROR;
+ CLR(bp->b_flags, B_ERROR);
st->flags &= ~ST_AT_FILEMARK;
s = splbio();
biodone(bp);
@@ -977,7 +977,7 @@ ststart(struct scsi_xfer *xs)
bp->b_resid = bp->b_bcount;
if (st->flags & ST_EIO_PENDING) {
bp->b_error = EIO;
- bp->b_flags |= B_ERROR;
+ SET(bp->b_flags, B_ERROR);
}
st->flags &= ~(ST_EOM_PENDING | ST_EIO_PENDING);
s = splbio();
@@ -1052,6 +1052,7 @@ st_buf_done(struct scsi_xfer *xs)
switch (xs->error) {
case XS_NOERROR:
bp->b_error = 0;
+ CLR(bp->b_flags, B_ERROR);
bp->b_resid = xs->resid;
break;
@@ -1063,6 +1064,7 @@ st_buf_done(struct scsi_xfer *xs)
error = st_interpret_sense(xs);
if (error == 0) {
bp->b_error = 0;
+ CLR(bp->b_flags, B_ERROR);
bp->b_resid = xs->resid;
break;
}
@@ -1087,7 +1089,7 @@ retry:
default:
bp->b_error = EIO;
- bp->b_flags |= B_ERROR;
+ SET(bp->b_flags, B_ERROR);
bp->b_resid = bp->b_bcount;
break;
}