Date: Tue, 21 Jun 2011 09:03:56 +0400 From: "Andrey V. Elsukov" <bu7cher@yandex.ru> To: Xin LI <delphij@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223356 - head/sbin/geom/class/part Message-ID: <4E00263C.4040802@yandex.ru> In-Reply-To: <201106210446.p5L4k0IZ080002@svn.freebsd.org> References: <201106210446.p5L4k0IZ080002@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig4B5615A34375DA2D5C465728 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On 21.06.2011 8:46, Xin LI wrote: > Author: delphij > Date: Tue Jun 21 04:46:00 2011 > New Revision: 223356 > URL: http://svn.freebsd.org/changeset/base/223356 >=20 > Log: > Mod the offset padding by alignment. Without this change we may > pad too much when underlying GEOM object have a zero stripesize. No. In any way offset value could not be greater than mediasize. And it do nothing when alignment value is 1. > MFC after: 1 month I did not MFC'd these changes yet. > Modified: > head/sbin/geom/class/part/geom_part.c >=20 > Modified: head/sbin/geom/class/part/geom_part.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sbin/geom/class/part/geom_part.c Tue Jun 21 04:06:39 2011 (r22= 3355) > +++ head/sbin/geom/class/part/geom_part.c Tue Jun 21 04:46:00 2011 (r22= 3356) > @@ -362,7 +362,7 @@ gpart_autofill_resize(struct gctl_req *r > goto done; > } > =20 > - offset =3D pp->lg_stripeoffset / pp->lg_sectorsize; > + offset =3D (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment; > last =3D (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0); > LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { > s =3D find_provcfg(pp, "index"); > @@ -497,7 +497,7 @@ gpart_autofill(struct gctl_req *req) > alignment =3D len; > =20 > /* Adjust parameters to stripeoffset */ > - offset =3D pp->lg_stripeoffset / pp->lg_sectorsize; > + offset =3D (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment; > start =3D ALIGNUP(start + offset, alignment); > if (size > alignment) > size =3D ALIGNDOWN(size, alignment); >=20 >=20 --=20 WBR, Andrey V. Elsukov --------------enig4B5615A34375DA2D5C465728 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJOACZCAAoJEAHF6gQQyKF6594IAI1jKu3de1KWJHx6gKrqpbUi ErKG+TdXURy+tonSC+tMkwnP7EYLWzM4xax+/wHQFh9vK6BwcTWWsYZcuEpt6Pee KmanfrEjNtpcq14ypOP6RytElEa1lDyQy96Vam+q1jLLVhTRYkuI3xpY6uk/1I4J lDty1lyomM2PqRpEOsMn0wtdKO71qllmyk2TWySF/uafihV18nHs+w3aSLreGN1w SZC0xTFFEtbvIOt4WwVusb8ZjAbSBDiUk57QJoQLGIEmBP3sBIPVcFhiRnrIdP0V Agi5hqbdQQTE3BJDi57GebaEGCGYqnGMdqOsjNdJ5y2yPUXGwI4JEd4InOvYq1g= =Lf+i -----END PGP SIGNATURE----- --------------enig4B5615A34375DA2D5C465728--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E00263C.4040802>