From 57512b16ae6413fc30f37f90cc5422f2cbd86529 Mon Sep 17 00:00:00 2001 From: "Andrey V. Elsukov" Date: Thu, 2 Jun 2011 22:15:19 +0000 Subject: [PATCH] Always use LCM when stripesize > 0. --- sbin/geom/class/part/geom_part.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/geom/class/part/geom_part.c b/sbin/geom/class/part/geom_part.c index a433a0fcdad6..ae9f4b7b4516 100644 --- a/sbin/geom/class/part/geom_part.c +++ b/sbin/geom/class/part/geom_part.c @@ -342,7 +342,7 @@ gpart_autofill_resize(struct gctl_req *req) if (alignment == 0) errx(EXIT_FAILURE, "Invalid alignment param"); lba = pp->lg_stripesize / pp->lg_sectorsize; - if (lba % alignment) + if (lba > 0) alignment = g_lcm(lba, alignment); } error = gctl_delete_param(req, "alignment"); @@ -496,7 +496,7 @@ gpart_autofill(struct gctl_req *req) * Use LCM from stripesize and user specified alignment. */ len = pp->lg_stripesize / pp->lg_sectorsize; - if (len % alignment) + if (len > 0 ) alignment = g_lcm(len, alignment); /* Adjust parameters to stripeoffset */