svn commit: r217205 - user/nwhitehorn/bsdinstall/partedit

Nathan Whitehorn nwhitehorn at FreeBSD.org
Sun Jan 9 21:02:12 UTC 2011


Author: nwhitehorn
Date: Sun Jan  9 21:02:11 2011
New Revision: 217205
URL: http://svn.freebsd.org/changeset/base/217205

Log:
  Made the adjustment to maxsize in the wrong place, which could fail for
  partition schemes with boot partitions like GPT.

Modified:
  user/nwhitehorn/bsdinstall/partedit/gpart_ops.c

Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c
==============================================================================
--- user/nwhitehorn/bsdinstall/partedit/gpart_ops.c	Sun Jan  9 20:53:13 2011	(r217204)
+++ user/nwhitehorn/bsdinstall/partedit/gpart_ops.c	Sun Jan  9 21:02:11 2011	(r217205)
@@ -604,7 +604,7 @@ gpart_create(struct gprovider *pp)
 	if (stripe > 0 && (firstfree*sector % stripe) != 0) 
 		firstfree += (stripe - ((firstfree*sector) % stripe)) / sector;
 
-	size = maxsize = end - firstfree;
+	size = end - firstfree;
 	if (size <= 0) {
 		dialog_msgbox("Error", "No free space left on device.", 0, 0,
 		    TRUE);
@@ -614,6 +614,7 @@ gpart_create(struct gprovider *pp)
 	/* Leave a free megabyte in case we need to write a boot partition */
 	if (size*sector >= 1024*1024)
 		size -= 1024*1024/sector;
+	maxsize = size;
 
 	humanize_number(sizestr, 7, size*sector, "B", HN_AUTOSCALE,
 	    HN_NOSPACE | HN_DECIMAL);


More information about the svn-src-user mailing list