diff --git a/sys/dev/vinum/vinuminterrupt.c b/sys/dev/vinum/vinuminterrupt.c index e47098fc5a7c..d473e918922e 100644 --- a/sys/dev/vinum/vinuminterrupt.c +++ b/sys/dev/vinum/vinuminterrupt.c @@ -342,7 +342,8 @@ complete_raid5_write(struct rqelement *rqe) if ((rqe->b.b_iocmd == BIO_READ) /* this was a read */ &&((rqe->flags & XFR_BAD_SUBDISK) == 0)) { /* and we can write this block */ - rqe->b.b_flags &= ~B_DONE; /* we're writing now */ + rqe->b.b_flags &= ~B_DONE; /* we're not done */ + rqe->b.b_iocmd = BIO_WRITE; /* we're writing now */ rqe->b.b_iodone = complete_rqe; /* call us here when done */ rqe->flags &= ~XFR_PARITYOP; /* reset flags that brought us here */ rqe->b.b_data = &bp->b_data[rqe->useroffset << DEV_BSHIFT]; /* point to the user data */ @@ -381,7 +382,8 @@ complete_raid5_write(struct rqelement *rqe) } /* Finally, write the parity block */ rqe = &rqg->rqe[0]; - rqe->b.b_flags &= ~B_DONE; /* we're writing now */ + rqe->b.b_flags &= ~B_DONE; /* we're not done */ + rqe->b.b_iocmd = BIO_WRITE; /* we're writing now */ rqe->b.b_iodone = complete_rqe; /* call us here when done */ rqg->flags &= ~XFR_PARITYOP; /* reset flags that brought us here */ rqe->b.b_bcount = rqe->buflen << DEV_BSHIFT; /* length to write */ diff --git a/sys/dev/vinum/vinumrequest.c b/sys/dev/vinum/vinumrequest.c index 3e86d7473efd..3d9d8c2ce5a0 100644 --- a/sys/dev/vinum/vinumrequest.c +++ b/sys/dev/vinum/vinumrequest.c @@ -792,7 +792,7 @@ build_rq_buffer(struct rqelement *rqe, struct plex *plex) /* Initialize the buf struct */ /* copy these flags from user bp */ bp->b_flags = ubp->b_flags & (B_ORDERED | B_NOCACHE | B_ASYNC); - bp->b_iocmd = BIO_READ; /* inform us when it's done */ + bp->b_iocmd = ubp->b_iocmd; BUF_LOCKINIT(bp); /* get a lock for the buffer */ BUF_LOCK(bp, LK_EXCLUSIVE); /* and lock it */ @@ -921,6 +921,7 @@ sdio(struct buf *bp) } bzero(sbp, sizeof(struct sdbuf)); /* start with nothing */ sbp->b.b_flags = bp->b_flags; + sbp->b.b_iocmd = bp->b_iocmd; sbp->b.b_bufsize = bp->b_bufsize; /* buffer size */ sbp->b.b_bcount = bp->b_bcount; /* number of bytes to transfer */ sbp->b.b_resid = bp->b_resid; /* and amount waiting */ diff --git a/sys/dev/vinum/vinumrevive.c b/sys/dev/vinum/vinumrevive.c index 32045121dabc..72ea732a7d2c 100644 --- a/sys/dev/vinum/vinumrevive.c +++ b/sys/dev/vinum/vinumrevive.c @@ -213,7 +213,7 @@ revive_block(int sdno) "Relaunch revive conflict sd %d: %p\n%s dev %d.%d, offset 0x%x, length %ld\n", rq->sdno, rq, - rq->bp->b_flags == BIO_READ ? "Read" : "Write", + rq->bp->b_iocmd == BIO_READ ? "Read" : "Write", major(rq->bp->b_dev), minor(rq->bp->b_dev), rq->bp->b_blkno,