Assert that bp->b_error == 0 if all data have been transfered in

physio_biodone(). We have more chance to have the fauly code in the
stack trace when doing the check here than in physio_done().
This commit is contained in:
bouyer 2008-11-09 12:18:07 +00:00
parent 61d904bdb2
commit 5da863e7e9
1 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_physio.c,v 1.88 2008/09/24 08:19:19 hannken Exp $ */
/* $NetBSD: kern_physio.c,v 1.89 2008/11/09 12:18:07 bouyer Exp $ */
/*-
* Copyright (c) 1982, 1986, 1990, 1993
@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_physio.c,v 1.88 2008/09/24 08:19:19 hannken Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_physio.c,v 1.89 2008/11/09 12:18:07 bouyer Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -173,10 +173,13 @@ physio_biodone(struct buf *bp)
#if defined(DIAGNOSTIC)
struct physio_stat *ps = bp->b_private;
size_t todo = bp->b_bufsize;
size_t done = bp->b_bcount - bp->b_resid;
KASSERT(ps->ps_running > 0);
KASSERT(bp->b_bcount <= todo);
KASSERT(bp->b_resid <= bp->b_bcount);
if (done == todo)
KASSERT(bp->b_error == 0);
#endif /* defined(DIAGNOSTIC) */
workqueue_enqueue(physio_workqueue, &bp->b_work, NULL);