summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2021-03-09 07:03:19 +0000
committerderaadt <deraadt@openbsd.org>2021-03-09 07:03:19 +0000
commitaad76447a88e9921dceb237b4e67eccc2e995711 (patch)
tree4b6067c8c4c2f9a3e44176cb3e3debfc5ef0c2b9
parentofw_read_mem_regions() can skip calculation of physmem. pmap.c (diff)
downloadwireguard-openbsd-aad76447a88e9921dceb237b4e67eccc2e995711.tar.xz
wireguard-openbsd-aad76447a88e9921dceb237b4e67eccc2e995711.zip
Do not adjust (uhm.. zero) the swap 'b' partition size if physmem is
zero (should not happen, but did), because the auto-allocate code will put a filesystem on that partition. ok otto kurt
-rw-r--r--sbin/disklabel/editor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index a7d9983a54c..86424f85ad5 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.366 2021/02/03 14:41:40 naddy Exp $ */
+/* $OpenBSD: editor.c,v 1.367 2021/03/09 07:03:19 deraadt Exp $ */
/*
* Copyright (c) 1997-2000 Todd C. Miller <millert@openbsd.org>
@@ -605,7 +605,7 @@ again:
/* bump max swap based on phys mem, little physmem gets 2x swap */
if (index == 0 && alloc_table == alloc_table_default) {
- if (physmem / DEV_BSIZE < MEG(256))
+ if (physmem && physmem / DEV_BSIZE < MEG(256))
alloc[1].minsz = alloc[1].maxsz = 2 * (physmem /
DEV_BSIZE);
else