svn commit: r225566 - stable/8/sbin/geom/class/part
Andrey V. Elsukov
ae at FreeBSD.org
Thu Sep 15 04:35:00 UTC 2011
Author: ae
Date: Thu Sep 15 04:34:59 2011
New Revision: 225566
URL: http://svn.freebsd.org/changeset/base/225566
Log:
MFC r223356 (by delphij):
Mod the offset padding by alignment. Without this change we may
pad too much when underlying GEOM object have a zero stripesize.
Modified:
stable/8/sbin/geom/class/part/geom_part.c
Directory Properties:
stable/8/sbin/geom/class/part/ (props changed)
Modified: stable/8/sbin/geom/class/part/geom_part.c
==============================================================================
--- stable/8/sbin/geom/class/part/geom_part.c Thu Sep 15 04:32:14 2011 (r225565)
+++ stable/8/sbin/geom/class/part/geom_part.c Thu Sep 15 04:34:59 2011 (r225566)
@@ -366,7 +366,7 @@ gpart_autofill_resize(struct gctl_req *r
goto done;
}
- offset = pp->lg_stripeoffset / pp->lg_sectorsize;
+ offset = (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment;
last = (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0);
LIST_FOREACH(pp, &gp->lg_provider, lg_provider) {
s = find_provcfg(pp, "index");
@@ -514,7 +514,7 @@ gpart_autofill(struct gctl_req *req)
alignment = len;
/* Adjust parameters to stripeoffset */
- offset = pp->lg_stripeoffset / pp->lg_sectorsize;
+ offset = (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment;
start = ALIGNUP(start + offset, alignment);
if (size > alignment)
size = ALIGNDOWN(size, alignment);
More information about the svn-src-stable
mailing list