summaryrefslogtreecommitdiffstats
path: root/sys/vm/swap_pager.c
diff options
context:
space:
mode:
authorcognet <cognet@FreeBSD.org>2006-01-27 21:11:50 +0000
committercognet <cognet@FreeBSD.org>2006-01-27 21:11:50 +0000
commitc2e2425399f48a6a8dfb780503a336df90250acd (patch)
tree7170802778afff98245407de1f04f3f134b2cb97 /sys/vm/swap_pager.c
parentc5069da841fe1d13c1e22517ee3510ffc0525eca (diff)
downloadFreeBSD-src-c2e2425399f48a6a8dfb780503a336df90250acd.zip
FreeBSD-src-c2e2425399f48a6a8dfb780503a336df90250acd.tar.gz
Make sure b_vp and b_bufobj are NULL before calling relpbuf(), as it asserts
they are. They should be NULL at this point, except if we're coming from swapdev_strategy(). It should only affect the case where we're swapping directly on a file over NFS.
Diffstat (limited to 'sys/vm/swap_pager.c')
-rw-r--r--sys/vm/swap_pager.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index a4ee9d6..1dfa279 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -1512,6 +1512,15 @@ swp_pager_async_iodone(struct buf *bp)
VM_OBJECT_UNLOCK(object);
}
+ /*
+ * swapdev_strategy() manually sets b_vp and b_bufobj before calling
+ * bstrategy(). Set them back to NULL now we're done with it, or we'll
+ * trigger a KASSERT in relpbuf().
+ */
+ if (bp->b_vp) {
+ bp->b_vp = NULL;
+ bp->b_bufobj = NULL;
+ }
/*
* release the physical I/O buffer
*/
OpenPOWER on IntegriCloud