diff options
author | ae <ae@FreeBSD.org> | 2011-06-07 11:11:11 +0000 |
---|---|---|
committer | ae <ae@FreeBSD.org> | 2011-06-07 11:11:11 +0000 |
commit | 81c81d4337809e30229236fb5fa9590d18c541df (patch) | |
tree | 39f9d6c3c35fc35a706d8510617af7dece796c03 /sbin/geom | |
parent | 187eee07df3631bcc10cf4f9863bae83471f8fe4 (diff) | |
download | FreeBSD-src-81c81d4337809e30229236fb5fa9590d18c541df.zip FreeBSD-src-81c81d4337809e30229236fb5fa9590d18c541df.tar.gz |
Do not use LCM from stripesize and user specified alignment value.
When user wants have specific alignment - do what user wants.
Use stripesize as alignment value in case, when some of gpart's
arguments are ommitted for automatic calculation.
Suggested by: mav
Diffstat (limited to 'sbin/geom')
-rw-r--r-- | sbin/geom/class/part/geom_part.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sbin/geom/class/part/geom_part.c b/sbin/geom/class/part/geom_part.c index ae9f4b7..55a055e 100644 --- a/sbin/geom/class/part/geom_part.c +++ b/sbin/geom/class/part/geom_part.c @@ -341,9 +341,10 @@ gpart_autofill_resize(struct gctl_req *req) errc(EXIT_FAILURE, error, "Invalid alignment param"); if (alignment == 0) errx(EXIT_FAILURE, "Invalid alignment param"); + } else { lba = pp->lg_stripesize / pp->lg_sectorsize; if (lba > 0) - alignment = g_lcm(lba, alignment); + alignment = lba; } error = gctl_delete_param(req, "alignment"); if (error) @@ -491,13 +492,9 @@ gpart_autofill(struct gctl_req *req) if (has_size && has_start && !has_alignment) goto done; - /* - * If stripesize is not zero, then recalculate alignment value. - * Use LCM from stripesize and user specified alignment. - */ len = pp->lg_stripesize / pp->lg_sectorsize; - if (len > 0 ) - alignment = g_lcm(len, alignment); + if (len > 0 && !has_alignment) + alignment = len; /* Adjust parameters to stripeoffset */ offset = pp->lg_stripeoffset / pp->lg_sectorsize; |