Date: Thu, 15 Sep 2011 04:35:00 +0000 (UTC) From: "Andrey V. Elsukov" <ae@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r225566 - stable/8/sbin/geom/class/part Message-ID: <201109150435.p8F4Z0QY056775@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201109150435.p8F4Z0QY056775>