diff options
Diffstat (limited to 'sys/geom/geom_slice.c')
-rw-r--r-- | sys/geom/geom_slice.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/geom/geom_slice.c b/sys/geom/geom_slice.c index 64745bf..35e7896 100644 --- a/sys/geom/geom_slice.c +++ b/sys/geom/geom_slice.c @@ -163,9 +163,6 @@ g_slice_start(struct bio *bp) /* Give the real method a chance to override */ if (gsp->start(bp)) return; - if (g_handleattr_off_t(bp, "GEOM::mediasize", - gsp->slices[index].length)) - return; if (!strcmp("GEOM::frontstuff", bp->bio_attribute)) { t = gsp->cfrontstuff; if (gsp->frontstuff > t) @@ -335,10 +332,12 @@ g_slice_new(struct g_class *mp, int slices, struct g_provider *pp, struct g_cons gp->spoiled = g_std_spoiled; gp->dumpconf = g_slice_dumpconf; cp = g_new_consumer(gp); - g_attach(cp, pp); - error = g_access_rel(cp, 1, 0, 0); + error = g_attach(cp, pp); + if (error == 0) + error = g_access_rel(cp, 1, 0, 0); if (error) { - g_detach(cp); + if (cp->provider != NULL) + g_detach(cp); g_destroy_consumer(cp); g_free(gsp->slices); g_free(gp->softc); |