diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2011-03-05 06:50:42 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2011-03-05 06:50:42 +0000 |
commit | 32a223f18f9f32a9e8bee410dd84f10cad90f7ec (patch) | |
tree | 966fbd573356baf3624d922c25d17766233bb3bf /sbin/disklabel | |
parent | 92bfb370614773d7052c95a296f0983778a8ebd1 (diff) |
If an auto-allocation scheme fails because there are not enough
available partitions (e.g. many spoofed logical partitions) try
the next scheme rather than giving up.
"sane" deraadt@ ok matthew@
Diffstat (limited to 'sbin/disklabel')
-rw-r--r-- | sbin/disklabel/editor.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index e34657af2f9..04b96829101 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.249 2011/03/02 04:48:24 krw Exp $ */ +/* $OpenBSD: editor.c,v 1.250 2011/03/05 06:50:41 krw Exp $ */ /* * Copyright (c) 1997-2000 Todd C. Miller <Todd.Miller@courtesan.com> @@ -587,8 +587,14 @@ again: for (j = 0; j < MAXPARTITIONS; j++) if (DL_GETPSIZE(&lp->d_partitions[j]) == 0) break; - if (j == MAXPARTITIONS) - return; + if (j == MAXPARTITIONS) { + /* It did not work out, try next strategy */ + free(alloc); + if (++index < nitems(alloc_table)) + goto again; + else + return; + } partno = j; pp = &lp->d_partitions[j]; partmp = &mountpoints[j]; |