Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/sysinst Disklabel partitions may start at the begin...



details:   https://anonhg.NetBSD.org/src/rev/ea56aa8bbc00
branches:  trunk
changeset: 999848:ea56aa8bbc00
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Jun 20 16:57:25 2019 +0000

description:
Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).

diffstat:

 usr.sbin/sysinst/disklabel.c |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (25 lines):

diff -r 20faadd94887 -r ea56aa8bbc00 usr.sbin/sysinst/disklabel.c
--- a/usr.sbin/sysinst/disklabel.c      Thu Jun 20 15:59:40 2019 +0000
+++ b/usr.sbin/sysinst/disklabel.c      Thu Jun 20 16:57:25 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disklabel.c,v 1.2 2019/06/13 06:20:34 martin Exp $     */
+/*     $NetBSD: disklabel.c,v 1.3 2019/06/20 16:57:25 martin Exp $     */
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -687,13 +687,11 @@
        size_t cnt = 0, i;
        daddr_t s, e, from, size, end_of_disk;
 
-       if (start <= LABELSECTOR)
-               start = LABELSECTOR+1;
-       if (parts->dp.disk_start != 0 && parts->dp.disk_start > start)
+       if (start < parts->dp.disk_start)
                start = parts->dp.disk_start;
        if (min_space_size < 1)
                min_space_size = 1;
-       if (align > 1)
+       if (align > 1 && (start % align) != 0)
                start = max(roundup(start, align), align);
        end_of_disk = parts->dp.disk_start + parts->dp.disk_size;
        from = start;



Home | Main Index | Thread Index | Old Index