aboutsummaryrefslogtreecommitdiff
path: root/sbin/geom
diff options
context:
space:
mode:
authorAndrey V. Elsukov <ae@FreeBSD.org>2012-05-04 19:49:24 +0000
committerAndrey V. Elsukov <ae@FreeBSD.org>2012-05-04 19:49:24 +0000
commitceeac1ac059dcbc5eaac1bc4459b6876ce54800f (patch)
tree891781dfaa8d7895ce54f2db1c5d3b61749f0c56 /sbin/geom
parent92fa7e24cb46aa50b0b6589f49a562bec5b94c59 (diff)
downloadsrc-ceeac1ac059dcbc5eaac1bc4459b6876ce54800f.tar.gz
src-ceeac1ac059dcbc5eaac1bc4459b6876ce54800f.zip
Don't ignore start offset value when user specifies it together
with alignment. PR: bin/167567 Tested by: Warren Block MFC after: 1 week
Notes
Notes: svn path=/head/; revision=235033
Diffstat (limited to 'sbin/geom')
-rw-r--r--sbin/geom/class/part/geom_part.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/geom/class/part/geom_part.c b/sbin/geom/class/part/geom_part.c
index 8296517ff7bf..8a57ca44ebf6 100644
--- a/sbin/geom/class/part/geom_part.c
+++ b/sbin/geom/class/part/geom_part.c
@@ -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] */