diff options
author | phk <phk@FreeBSD.org> | 2003-07-18 11:01:23 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-07-18 11:01:23 +0000 |
commit | 6fd98eaab7dbec310ee4eb31ef2d2d7291d01613 (patch) | |
tree | c8aa99d6465228b7aacdc908d38612e2a2854d13 /sys | |
parent | aa8896f3b8851237470823d4b6b9e14b8943d806 (diff) | |
download | FreeBSD-src-6fd98eaab7dbec310ee4eb31ef2d2d7291d01613.zip FreeBSD-src-6fd98eaab7dbec310ee4eb31ef2d2d7291d01613.tar.gz |
If a proposed swap device exceeds the 8G artificial limit which out
radix-tree code imposes, truncate the device instead of rejecting it.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/vm/swap_pager.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index d9fe68b..a55b187 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -2470,7 +2470,7 @@ swaponvp(td, vp, dev, nblks) long blk; swblk_t dvbase; int error; - u_long aligned_nblks; + u_long aligned_nblks, mblocks; off_t mediasize; if (!swapdev_vp) { @@ -2520,11 +2520,11 @@ swaponvp(td, vp, dev, nblks) * If we go beyond this, we get overflows in the radix * tree bitmap code. */ - if (nblks > 0x40000000 / BLIST_META_RADIX / nswdev) { - printf("exceeded maximum of %d blocks per swap unit\n", - 0x40000000 / BLIST_META_RADIX / nswdev); - (void) VOP_CLOSE(vp, FREAD | FWRITE, td->td_ucred, td); - return (ENXIO); + mblocks = 0x40000000 / BLIST_META_RADIX / nswdev; + if (nblks > mblocks) { + printf("WARNING: reducing size to maximum of %d blocks per swap unit\n", + mblocks); + nblks = mblocks; } /* * nblks is in DEV_BSIZE'd chunks, convert to PAGE_SIZE'd chunks. |