svn commit: r223356 - head/sbin/geom/class/part

Andrey V. Elsukov bu7cher at yandex.ru
Tue Jun 21 05:20:20 UTC 2011


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
> 
> 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
> 
> Modified: head/sbin/geom/class/part/geom_part.c
> ==============================================================================
> --- head/sbin/geom/class/part/geom_part.c	Tue Jun 21 04:06:39 2011	(r223355)
> +++ head/sbin/geom/class/part/geom_part.c	Tue Jun 21 04:46:00 2011	(r223356)
> @@ -362,7 +362,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");
> @@ -497,7 +497,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);
> 
> 


-- 
WBR, Andrey V. Elsukov

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20110621/6f5edc1d/signature.pgp


More information about the svn-src-all mailing list