summaryrefslogtreecommitdiff
path: root/sys/dev/vnd.c
diff options
context:
space:
mode:
authorThordur I. Bjornsson <thib@cvs.openbsd.org>2010-07-22 14:34:07 +0000
committerThordur I. Bjornsson <thib@cvs.openbsd.org>2010-07-22 14:34:07 +0000
commite2d76dea27904cbab76eea70f63b71106344667e (patch)
treede463219155497f8616bd68a8d3d0e21d4e1fd42 /sys/dev/vnd.c
parent58bbd3eb627989a728fc032f9b1bb22025f780b7 (diff)
Instead of trying to biowait on a buf that has errored, do the
right thing, throw it away by marking it as B_INVAL and setting the B_ERROR flag and b_error to the errno that was returned. B_RAW doesn't matter there. Issue report my mlarkin@, this diff tested and confirmed to fix the issue by mlarkin also, thanks! OK krw@, beck@, deraadt@
Diffstat (limited to 'sys/dev/vnd.c')
-rw-r--r--sys/dev/vnd.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c
index 75dc8cada3d..995525a869e 100644
--- a/sys/dev/vnd.c
+++ b/sys/dev/vnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnd.c,v 1.99 2010/07/01 17:48:33 thib Exp $ */
+/* $OpenBSD: vnd.c,v 1.100 2010/07/22 14:34:06 thib Exp $ */
/* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */
/*
@@ -660,24 +660,29 @@ vndiodone(struct buf *bp)
DNPRINTF(VDB_IO, "vndiodone: vbp %p error %d\n", vbp,
vbp->vb_buf.b_error);
- pbp->b_flags |= B_ERROR;
- /* XXX does this matter here? */
- (&vbp->vb_buf)->b_flags |= B_RAW;
- pbp->b_error = biowait(&vbp->vb_buf);
+ pbp->b_flags |= (B_ERROR|B_INVAL);
+ pbp->b_error = vbp->vb_buf.b_error;
+ pbp->b_iodone = NULL;
+ biodone(pbp);
+ goto out;
}
+
pbp->b_resid -= vbp->vb_buf.b_bcount;
+
+ if (pbp->b_resid == 0) {
+ DNPRINTF(VDB_IO, "vndiodone: pbp %p iodone\n", pbp);
+ biodone(pbp);
+ }
+
+out:
putvndbuf(vbp);
+
if (vnd->sc_tab.b_active) {
disk_unbusy(&vnd->sc_dk, (pbp->b_bcount - pbp->b_resid),
(pbp->b_flags & B_READ));
if (!vnd->sc_tab.b_actf)
vnd->sc_tab.b_active--;
}
- if (pbp->b_resid == 0) {
- DNPRINTF(VDB_IO, "vndiodone: pbp %p iodone\n", pbp);
- biodone(pbp);
- }
-
}
/* ARGSUSED */