summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_swap.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vm/vm_swap.c')
-rw-r--r--sys/vm/vm_swap.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c
index 8691c22..fada384 100644
--- a/sys/vm/vm_swap.c
+++ b/sys/vm/vm_swap.c
@@ -53,6 +53,7 @@
#include <sys/stat.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
+#include <vm/vm_zone.h>
#include <vm/swap_pager.h>
/*
@@ -194,6 +195,13 @@ swapon(p, uap)
if (error)
return (error);
+ /*
+ * Swap metadata may not fit in the KVM if we have physical
+ * memory of >1GB.
+ */
+ if (swap_zone == NULL)
+ return (ENOMEM);
+
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->name, p);
error = namei(&nd);
if (error)
OpenPOWER on IntegriCloud