Source-Changes-HG archive

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

[src/netbsd-6]: src/distrib/utils/sysinst Pull up following revision(s) (requ...



details:   https://anonhg.NetBSD.org/src/rev/1b772321a63f
branches:  netbsd-6
changeset: 774199:1b772321a63f
user:      riz <riz%NetBSD.org@localhost>
date:      Tue Jun 12 19:19:20 2012 +0000

description:
Pull up following revision(s) (requested by tsutsui in ticket #317):
        distrib/utils/sysinst/mbr.c: revision 1.91
Fix regression by my dumb patch in PR/45990.
sysinst fails with "floating exception" after
changing MBR partition size in MBR editor menu
if the target disk doesn't have valid MBR partition
or has a valid partition 0 whose offset is not 1MB aligned
(like 63 sectors).
read_mbr() (which calls get_ptn_alignment()) is called
before set_bios_geom(), so bhead is not initialized there
and ptn_alignment could be zero.
To workaround, explicitly call get_ptn_alignment() again
in edit_mbr() to update ptn_alignemnt per BIOS geom values.

diffstat:

 distrib/utils/sysinst/mbr.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 32ee2caf798a -r 1b772321a63f distrib/utils/sysinst/mbr.c
--- a/distrib/utils/sysinst/mbr.c       Tue Jun 12 19:11:50 2012 +0000
+++ b/distrib/utils/sysinst/mbr.c       Tue Jun 12 19:19:20 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mbr.c,v 1.89.2.1 2012/05/17 18:57:08 sborrill Exp $ */
+/*     $NetBSD: mbr.c,v 1.89.2.2 2012/06/12 19:19:20 riz Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1271,6 +1271,7 @@
        /* Ask full/part */
 
        part = &mbrs->mbr_parts[0];
+       get_ptn_alignment(part);        /* update ptn_alignment */
        msg_display(MSG_fullpart, diskdev);
        process_menu(MENU_fullpart, &usefull);
 
@@ -1477,7 +1478,7 @@
 
                mbrp = &mbrs->mbr_parts[0];
                if (ext_base == 0) {
-                       get_ptn_alignment(mbrp);
+                       get_ptn_alignment(mbrp);        /* get ptn_0_offset */
                } else {
                        /* sanity check extended chain */
                        if (MBR_IS_EXTENDED(mbrp[0].mbrp_type))



Home | Main Index | Thread Index | Old Index