diff options
-rw-r--r-- | sys/geom/geom_bsd.c | 5 | ||||
-rw-r--r-- | sys/geom/geom_slice.c | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/sys/geom/geom_bsd.c b/sys/geom/geom_bsd.c index f44eb76..a711bbc 100644 --- a/sys/geom/geom_bsd.c +++ b/sys/geom/geom_bsd.c @@ -555,6 +555,7 @@ g_bsd_hotwrite(void *arg) struct bio *bp; struct g_geom *gp; struct g_slicer *gsp; + struct g_slice *gsl; struct g_bsd_softc *ms; struct g_bsd_softc fake; u_char *p; @@ -564,7 +565,9 @@ g_bsd_hotwrite(void *arg) gp = bp->bio_to->geom; gsp = gp->softc; ms = gsp->softc; - p = bp->bio_data + ms->labeloffset - bp->bio_offset; + gsl = &gsp->slices[bp->bio_to->index]; + p = bp->bio_data + ms->labeloffset + - (bp->bio_offset + gsl->offset); g_bsd_ledec_disklabel(p, &fake.ondisk); ondisk2inram(&fake); diff --git a/sys/geom/geom_slice.c b/sys/geom/geom_slice.c index 8bcf52c..82df9fb 100644 --- a/sys/geom/geom_slice.c +++ b/sys/geom/geom_slice.c @@ -184,11 +184,12 @@ g_slice_start(struct bio *bp) * Check if we collide with any hot spaces, and call the * method once if so. */ + t = bp->bio_offset + gsl->offset; for (m_index = 0; m_index < gsp->nhot; m_index++) { gmp = &gsp->hot[m_index]; - if (bp->bio_offset >= gmp->offset + gmp->length) + if (t >= gmp->offset + gmp->length) continue; - if (bp->bio_offset + bp->bio_length <= gmp->offset) + if (t + bp->bio_length <= gmp->offset) continue; error = gsp->start(bp); if (error == EJUSTRETURN) |