summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorThordur I. Bjornsson <thib@cvs.openbsd.org>2006-08-13 17:55:08 +0000
committerThordur I. Bjornsson <thib@cvs.openbsd.org>2006-08-13 17:55:08 +0000
commitce113dfef9f51e506a6dbc680f6ec4cb9994f466 (patch)
tree2008d18c8ac7ec403e2bd5a0143d82832e55c9de /sys
parent3f57aa97954a50188b399bf7b07c5758bb1f5115 (diff)
fix a panic when trying to fdisk vnd devices (not svnd) wich
are back by weird images (such as the ones qemu creates). proplem found the hard way by msf@ ok mickey@, pedro@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/vnd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c
index dd9c51577e6..535cbb42014 100644
--- a/sys/dev/vnd.c
+++ b/sys/dev/vnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnd.c,v 1.61 2006/08/12 13:53:44 krw Exp $ */
+/* $OpenBSD: vnd.c,v 1.62 2006/08/13 17:55:07 thib Exp $ */
/* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */
/*
@@ -600,12 +600,17 @@ vndstrategy(bp)
*
* XXX we could deal with holes here but it would be
* a hassle (in the write case).
+ * We must still however charge for the write even if there
+ * was an error.
*/
if (error) {
nbp->vb_buf.b_error = error;
nbp->vb_buf.b_flags |= B_ERROR;
bp->b_resid -= (resid - sz);
s = splbio();
+ /* charge for the write */
+ if ((nbp->vb_buf.b_flags & B_READ) == 0)
+ nbp->vb_buf.b_vp->v_numoutput++;
biodone(&nbp->vb_buf);
splx(s);
return;