diff options
author | le <le@FreeBSD.org> | 2004-09-30 12:57:35 +0000 |
---|---|---|
committer | le <le@FreeBSD.org> | 2004-09-30 12:57:35 +0000 |
commit | ada7c51edc72a4c9783343b1af3a2335f448baed (patch) | |
tree | 6a80fd9dd1fc6bc23ae20575319c461f4e1c54ec /sys/geom/vinum/geom_vinum_plex.c | |
parent | b0a3fc4cda4ac786b04578ff6fe1a009fd38f6e5 (diff) | |
download | FreeBSD-src-ada7c51edc72a4c9783343b1af3a2335f448baed.zip FreeBSD-src-ada7c51edc72a4c9783343b1af3a2335f448baed.tar.gz |
Make it possible to rebuild degraded RAID5 plexes. Note that it is
currently not possible to do this while the volume is mounted.
MFC in: 1 week
Diffstat (limited to 'sys/geom/vinum/geom_vinum_plex.c')
-rw-r--r-- | sys/geom/vinum/geom_vinum_plex.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/geom/vinum/geom_vinum_plex.c b/sys/geom/vinum/geom_vinum_plex.c index 494ec2c..7ce5b08 100644 --- a/sys/geom/vinum/geom_vinum_plex.c +++ b/sys/geom/vinum/geom_vinum_plex.c @@ -295,7 +295,9 @@ gv_plex_worker(void *arg) /* A completed request. */ if (bp->bio_cflags & GV_BIO_DONE) { g_free(bq); - if (bp->bio_cflags & GV_BIO_SYNCREQ) { + + if (bp->bio_cflags & GV_BIO_SYNCREQ || + bp->bio_cflags & GV_BIO_REBUILD) { s = bp->bio_to->private; if (bp->bio_error == 0) s->initialized += bp->bio_length; @@ -306,8 +308,11 @@ gv_plex_worker(void *arg) g_topology_unlock(); s->initialized = 0; } + } + + if (bp->bio_cflags & GV_BIO_SYNCREQ) g_std_done(bp); - } else + else gv_plex_completed_request(p, bp); /* * A sub-request that was hold back because it interfered with @@ -457,7 +462,12 @@ gv_plex_normal_request(struct gv_plex *p, struct bio *bp) wp->bio = bp; TAILQ_INIT(&wp->bits); - err = gv_build_raid5_req(p, wp, bp, addr, boff, bcount); + if (bp->bio_cflags & GV_BIO_REBUILD) + err = gv_rebuild_raid5(p, wp, bp, addr, + boff, bcount); + else + err = gv_build_raid5_req(p, wp, bp, addr, + boff, bcount); /* * Building the sub-request failed, we probably need to |