Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 May 2012 04:02:17 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r235258 - stable/9/sbin/geom/class/part
Message-ID:  <201205110402.q4B42Hjc065339@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Fri May 11 04:02:17 2012
New Revision: 235258
URL: http://svn.freebsd.org/changeset/base/235258

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/9/sbin/geom/class/part/geom_part.c
Directory Properties:
  stable/9/sbin/geom/class/part/   (props changed)

Modified: stable/9/sbin/geom/class/part/geom_part.c
==============================================================================
--- stable/9/sbin/geom/class/part/geom_part.c	Fri May 11 03:17:32 2012	(r235257)
+++ stable/9/sbin/geom/class/part/geom_part.c	Fri May 11 04:02:17 2012	(r235258)
@@ -507,6 +507,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");
 		lba = (off_t)strtoimax(s, NULL, 0);
@@ -536,7 +538,8 @@ gpart_autofill(struct gctl_req *req)
 
 		s = find_provcfg(pp, "end");
 		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] */



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