diff --git a/sys/kern/subr_blist.c b/sys/kern/subr_blist.c index 2cb405236734..e8a47548142d 100644 --- a/sys/kern/subr_blist.c +++ b/sys/kern/subr_blist.c @@ -251,6 +251,8 @@ blist_alloc(blist_t bl, daddr_t count) bl->bl_radix); if (blk != SWAPBLK_NONE) { bl->bl_cursor = blk + count; + if (bl->bl_cursor == bl->bl_blocks) + bl->bl_cursor = 0; return (blk); } else if (bl->bl_cursor != 0) bl->bl_cursor = 0;