svn commit: r235259 - stable/8/sbin/geom/class/part

Andrey V. Elsukov ae at FreeBSD.org
Fri May 11 04:02:38 UTC 2012


Author: ae
Date: Fri May 11 04:02:37 2012
New Revision: 235259
URL: http://svn.freebsd.org/changeset/base/235259

Log:
  MFC r235033:
    Don't ignore start offset value when user specifies it together
    with alignment.
  
    PR:		bin/167567
    Tested by:	Warren Block

Modified:
  stable/8/sbin/geom/class/part/geom_part.c
Directory Properties:
  stable/8/sbin/geom/class/part/   (props changed)

Modified: stable/8/sbin/geom/class/part/geom_part.c
==============================================================================
--- stable/8/sbin/geom/class/part/geom_part.c	Fri May 11 04:02:17 2012	(r235258)
+++ stable/8/sbin/geom/class/part/geom_part.c	Fri May 11 04:02:37 2012	(r235259)
@@ -524,6 +524,8 @@ gpart_autofill(struct gctl_req *req)
 	grade = ~0ULL;
 	a_first = ALIGNUP(first + offset, alignment);
 	last = ALIGNDOWN(last + offset, alignment);
+	if (a_first < start)
+		a_first = start;
 	while ((pp = find_provider(gp, first)) != NULL) {
 		s = find_provcfg(pp, "start");
 		if (s == NULL) {
@@ -563,7 +565,8 @@ gpart_autofill(struct gctl_req *req)
 			    (off_t)strtoimax(s, NULL, 0) / pp->lg_sectorsize;
 		} else
 			first = (off_t)strtoimax(s, NULL, 0) + 1;
-		a_first = ALIGNUP(first + offset, alignment);
+		if (first > a_first)
+			a_first = ALIGNUP(first + offset, alignment);
 	}
 	if (a_first <= last) {
 		/* Free space [first-last] */


More information about the svn-src-stable-8 mailing list