diff options
author | Julian Elischer <julian@FreeBSD.org> | 1995-10-12 02:02:03 +0000 |
---|---|---|
committer | Julian Elischer <julian@FreeBSD.org> | 1995-10-12 02:02:03 +0000 |
commit | 827d45ab08f6c46055dd23b688b554bae0b0f164 (patch) | |
tree | 44daeb2ea32052b14579455742896990e43b178f /sys/scsi/st.c | |
parent | 3948edc24ce0e300500f56d903a4cd69ab8bcbf7 (diff) | |
download | src-827d45ab08f6c46055dd23b688b554bae0b0f164.tar.gz src-827d45ab08f6c46055dd23b688b554bae0b0f164.zip |
Ack!
sometime around 1.51, the check for minphys dissappeared out of
transfers for disks..
we weren't hecking that the adapter could handle a transfer of
the size we were requesting..
Peter!?
:)
this explains the rash of failures I've seen reported recently
with "too many DMA segments" on raw devices
(added one for st as well)
Notes
Notes:
svn path=/head/; revision=11439
Diffstat (limited to 'sys/scsi/st.c')
-rw-r--r-- | sys/scsi/st.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/sys/scsi/st.c b/sys/scsi/st.c index 7f5676968ed5..b59c9e216bf4 100644 --- a/sys/scsi/st.c +++ b/sys/scsi/st.c @@ -12,7 +12,7 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * $Id: st.c,v 1.37 1995/07/09 08:14:24 joerg Exp $ + * $Id: st.c,v 1.38 1995/07/16 09:13:14 gibbs Exp $ */ /* @@ -904,6 +904,7 @@ st_strategy(struct buf *bp, struct scsi_link *sc_link) unsigned char unit; /* XXX Everywhere else unit is "u_int32". Please int? */ u_int32 opri; struct scsi_data *st; + int len; ststrats++; unit = STUNIT((bp->b_dev)); @@ -911,10 +912,14 @@ st_strategy(struct buf *bp, struct scsi_link *sc_link) /* * If it's a null transfer, return immediatly */ - if (bp->b_bcount == 0) { + if ((len = bp->b_bcount) == 0) { goto done; } /* + * Check the adapter can do it + */ + scsi_minphys(bp,&st_switch); + /* * Odd sized request on fixed drives are verboten */ if (st->flags & ST_FIXEDBLOCKS) { @@ -927,12 +932,21 @@ st_strategy(struct buf *bp, struct scsi_link *sc_link) } /* * as are out-of-range requests on variable drives. + * (or if we got chopped by minphys) */ - else if (bp->b_bcount < st->blkmin || bp->b_bcount > st->blkmax) { - printf("st%d: bad request, must be between %ld and %ld\n", - unit, st->blkmin, st->blkmax); - bp->b_error = EIO; - goto bad; + else { + if ((bp->b_bcount < st->blkmin || bp->b_bcount > st->blkmax)) { + printf("st%d: bad request, must be between %ld and %ld\n", + unit, st->blkmin, st->blkmax); + bp->b_error = EIO; + goto bad; + } + if (len != bp->b_bcount) { + printf("st%d: bad request, must be less than %ld bytes\n", + unit, bp->b_bcount + 1 + bp->b_error = EIO; + goto bad; + } } opri = splbio(); |