From: deraadt Date: Tue, 9 Mar 2021 07:03:19 +0000 (+0000) Subject: Do not adjust (uhm.. zero) the swap 'b' partition size if physmem is X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=aad76447a88e9921dceb237b4e67eccc2e995711;p=openbsd 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 --- 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 @@ -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