diff options
author | bde <bde@FreeBSD.org> | 1999-01-15 09:15:27 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1999-01-15 09:15:27 +0000 |
commit | 836496c3c77585a9603b1ce20cc257c7eb818729 (patch) | |
tree | 8d535d68d43610ad6ed9b8527ae3c4c8ab59e031 /sys/isa/fd.c | |
parent | 69a1352a25afd31d1b5a63f514d886cdb2864e28 (diff) | |
download | FreeBSD-src-836496c3c77585a9603b1ce20cc257c7eb818729.zip FreeBSD-src-836496c3c77585a9603b1ce20cc257c7eb818729.tar.gz |
Fixed corruption of the fd buffer queue. Once upon a time, the active
buffer had to be left on the head of the queue for [bufq]disksort()
to sort against. This isn't right for devices that can support multiple
active i/o's, and only the fd driver did it. "Fixing" this in rev.1.36
of ufs_disksubr.c broke the fd driver in much the same way as rev.1.52
of <sys/buf.h> broke it (see rev.1.119).
Bug reported and fix tested by: dt
Diffstat (limited to 'sys/isa/fd.c')
-rw-r--r-- | sys/isa/fd.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/sys/isa/fd.c b/sys/isa/fd.c index 5380d54..c8e35a5 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.c @@ -47,7 +47,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.129 1998/12/14 16:29:58 bde Exp $ + * $Id: fd.c,v 1.130 1998/12/27 13:40:56 phk Exp $ * */ @@ -1530,8 +1530,15 @@ fdstate(fdcu_t fdcu, fdc_p fdc) struct fd_formb *finfo = NULL; size_t fdblk; - bp = bufq_first(&fdc->head); - if(!bp) { + bp = fdc->bp; + if (bp == NULL) { + bp = bufq_first(&fdc->head); + if (bp != NULL) { + bufq_remove(&fdc->head, bp); + fdc->bp = bp; + } + } + if (bp == NULL) { /***********************************************\ * nothing left for this controller to do * * Force into the IDLE state, * @@ -1903,7 +1910,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc) { /* ALL DONE */ fd->skip = 0; - bufq_remove(&fdc->head, bp); + fdc->bp = NULL; /* Tell devstat we have finished with the transaction */ devstat_end_transaction(&fd->device_stats, bp->b_bcount - bp->b_resid, @@ -2026,7 +2033,7 @@ retrier(fdcu) fdc_p fdc = fdc_data + fdcu; register struct buf *bp; - bp = bufq_first(&fdc->head); + bp = fdc->bp; if(fd_data[FDUNIT(minor(bp->b_dev))].options & FDOPT_NORETRY) goto fail; @@ -2070,7 +2077,7 @@ retrier(fdcu) bp->b_flags |= B_ERROR; bp->b_error = EIO; bp->b_resid += bp->b_bcount - fdc->fd->skip; - bufq_remove(&fdc->head, bp); + fdc->bp = NULL; /* Tell devstat we have finished with the transaction */ devstat_end_transaction(&fdc->fd->device_stats, |