Mod the offset padding by alignment. Without this change we may
pad too much when underlying GEOM object have a zero stripesize. MFC after: 1 month
This commit is contained in:
parent
8e166a461c
commit
d740ec2e35
@ -362,7 +362,7 @@ gpart_autofill_resize(struct gctl_req *req)
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user