Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jul 2002 15:57:11 +0200 (CEST)
From:      Thomas Zenker <thz@Lennartz-electronic.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/40655: patch: sysinstall assigns partition a to swap
Message-ID:  <200207161357.g6GDvBIs072780@mezcal.tue.le>

next in thread | raw e-mail | index | archive | help

>Number:         40655
>Category:       bin
>Synopsis:       patch: sysinstall assigns partition a to swap
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 16 07:00:04 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Thomas Zenker
>Release:        FreeBSD 4.6-RELEASE i386
>Organization:
>Environment:
System: FreeBSD mezcal.tue.le 4.6-RELEASE FreeBSD 4.6-RELEASE #8: Mon Jun 10 11:22:51 CEST 2002 thz@mezcal.tue.le:/usr/obj/usr/src/sys/MEZCAL i386


	applies to all versions of sysinstall
>Description:
	scripted partitioning of a disk can lead to a swap partition
	assigned to partition a (normally root). The problem is caused
	by not reseting a flag, so CHUNK_IS_ROOT contaminates the next
	chunk/slice.
>How-To-Repeat:
	swap is first partition in a slice after assigning the root partition
	in the previous slice.
>Fix:
	Following patch applies to current and stable.

Index: label.c
===================================================================
RCS file: /usr/cvs/FreeBSD/src/usr.sbin/sysinstall/label.c,v
retrieving revision 1.118
diff -u -r1.118 label.c
--- label.c	7 Jun 2002 15:32:05 -0000	1.118
+++ label.c	16 Jul 2002 13:25:34 -0000
@@ -1361,7 +1361,7 @@
     char *cp;
     PartType type;
     PartInfo *p;
-    u_long flags = 0;
+    u_long flags;
     int i, status;
     Device **devs;
     Disk *d;
@@ -1406,6 +1406,7 @@
 		    else {
 			Chunk *tmp;
 
+			flags = 0;
 			if (!strcmp(typ, "swap")) {
 			    type = PART_SWAP;
 			    strcpy(mpoint, "SWAP");
@@ -1414,8 +1415,6 @@
 			    type = PART_FILESYSTEM;
 			    if (!strcmp(mpoint, "/"))
 				flags |= CHUNK_IS_ROOT;
-			    else
-				flags &= ~CHUNK_IS_ROOT;
 			}
 			if (!sz)
 			    sz = space_free(c1);
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200207161357.g6GDvBIs072780>