Author: ae
Date: Fri May  4 19:49:24 2012
New Revision: 235033
URL: http://svn.freebsd.org/changeset/base/235033

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

Modified:
  head/sbin/geom/class/part/geom_part.c

Modified: head/sbin/geom/class/part/geom_part.c
==============================================================================
--- head/sbin/geom/class/part/geom_part.c       Fri May  4 19:44:58 2012        
(r235032)
+++ head/sbin/geom/class/part/geom_part.c       Fri May  4 19:49:24 2012        
(r235033)
@@ -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] */
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to