For contained slices, the offset of the new device should be from the start
of the containing device, which is what you are creating the new device on top
of. It should not be the offset from the start of the entire disk.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
d = c;
while (c) {
for (j = 0; j < n; j++) {
+ uint64_t start;
int k = slices[j].container - 1;
if (slices[j].size == 0)
continue;
/* Skip all simple slices */
- if (k < 0)
+ if (slices[j].container == 0)
continue;
/* Check container slice */
}
strip_slash(partname);
+ start = slices[j].start - slices[k].start;
if (safe_sprintf(params, "%d:%d %" PRIu64,
slices[k].major,
slices[k].minor,
- slices[j].start)) {
+ start)) {
fprintf(stderr, "params too small\n");
exit(1);
}