diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 53ad161a86cb..b844d029e9f9 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -1359,7 +1359,9 @@ swap_pager_putpages(object, m, count, sync, rtvals) cnt.v_swapout++; cnt.v_swappgsout += bp->b_npages; + VI_LOCK(swapdev_vp); swapdev_vp->v_numoutput++; + VI_UNLOCK(swapdev_vp); splx(s); diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c index 80766e501052..6d16e38b35de 100644 --- a/sys/vm/vm_swap.c +++ b/sys/vm/vm_swap.c @@ -151,7 +151,9 @@ swapdev_strategy(ap) } VI_UNLOCK(vp); } + VI_LOCK(sp->sw_vp); sp->sw_vp->v_numoutput++; + VI_UNLOCK(sp->sw_vp); } bp->b_vp = sp->sw_vp; splx(s);