--- a/sys/uvm/uvm_swap.c 23 Aug 2021 13:08:18 -0000 1.206 +++ b/sys/uvm/uvm_swap.c 30 Jun 2022 05:00:23 -0000 @@ -1478,7 +1478,10 @@ out: /* Arrive here at splbio */ if (vnx->vx_pending == 0) { error = vnx->vx_error; pool_put(&vndxfer_pool, vnx); - bp->b_error = error; + if (error) { + bp->b_resid = bp->b_bcount; + bp->b_error = error; + } biodone(bp); } splx(s); @@ -1585,6 +1588,7 @@ sw_reg_iodone(struct work *wk, void *dum error = vnx->vx_error; if ((vnx->vx_flags & VX_BUSY) == 0 && vnx->vx_pending == 0) { pbp->b_error = error; + pbp->b_resid = pbp->b_bcount; biodone(pbp); pool_put(&vndxfer_pool, vnx); }