aboutsummaryrefslogtreecommitdiff
path: root/sys/geom/geom_slice.c
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2003-02-11 15:23:41 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2003-02-11 15:23:41 +0000
commit8028f16b1b8a71378111b4505aa48242f4c01a11 (patch)
tree8316985414fa526c1186d252005fde5ec5ac0cb6 /sys/geom/geom_slice.c
parent200c8a23cde475e4b40344bea83f84fa1c408596 (diff)
downloadsrc-8028f16b1b8a71378111b4505aa48242f4c01a11.tar.gz
src-8028f16b1b8a71378111b4505aa48242f4c01a11.zip
Notes
Diffstat (limited to 'sys/geom/geom_slice.c')
-rw-r--r--sys/geom/geom_slice.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/geom/geom_slice.c b/sys/geom/geom_slice.c
index 11f1380634f2..43fbc5ff3a31 100644
--- a/sys/geom/geom_slice.c
+++ b/sys/geom/geom_slice.c
@@ -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,