Don't divide by zero if there is no stripewidth specified.
This commit is contained in:
parent
200c8a23cd
commit
8028f16b1b
@ -348,8 +348,10 @@ g_slice_config(struct g_geom *gp, u_int idx, int how, off_t offset, off_t length
|
||||
pp = g_new_providerf(gp, sbuf_data(sb));
|
||||
pp2 = LIST_FIRST(&gp->consumer)->provider;
|
||||
pp->flags = pp2->flags & G_PF_CANDELETE;
|
||||
pp->stripesize = pp2->stripesize;
|
||||
pp->stripeoffset = (pp2->stripeoffset + offset) % pp->stripesize;
|
||||
if (pp2->stripesize > 0) {
|
||||
pp->stripesize = pp2->stripesize;
|
||||
pp->stripeoffset = (pp2->stripeoffset + offset) % pp->stripesize;
|
||||
}
|
||||
if (bootverbose)
|
||||
printf("GEOM: Configure %s, start %jd length %jd end %jd\n",
|
||||
pp->name, (intmax_t)offset, (intmax_t)length,
|
||||
|
Loading…
x
Reference in New Issue
Block a user