diff options
author | le <le@FreeBSD.org> | 2004-07-24 22:26:40 +0000 |
---|---|---|
committer | le <le@FreeBSD.org> | 2004-07-24 22:26:40 +0000 |
commit | 9795b96112070c79a1bd42f4f7a64debfb11889d (patch) | |
tree | e868592d11ae6a43efce2556fc076c05f469bb41 /sys/geom/vinum/geom_vinum.c | |
parent | 4eaecd41f31309b86bf7e73c017f01bd2f1f14b4 (diff) | |
download | FreeBSD-src-9795b96112070c79a1bd42f4f7a64debfb11889d.zip FreeBSD-src-9795b96112070c79a1bd42f4f7a64debfb11889d.tar.gz |
Use a temporary geom when tasting vinumdrives and lock the 'real'
vinumdrive geom with an exclusive bit. This should fix the problem
when underlying partitions overlap (i.e. the 'a' partition is at
the same offset as the 'c' partition).
Ideas borrowed from pjd@, quite a bit of testing by
Matthias Schuendehuette <msch@snafu.de>.
Diffstat (limited to 'sys/geom/vinum/geom_vinum.c')
-rw-r--r-- | sys/geom/vinum/geom_vinum.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/geom/vinum/geom_vinum.c b/sys/geom/vinum/geom_vinum.c index f756132..f33280a 100644 --- a/sys/geom/vinum/geom_vinum.c +++ b/sys/geom/vinum/geom_vinum.c @@ -540,6 +540,7 @@ static int gv_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp) { struct g_geom *gp2; + struct g_consumer *cp; struct gv_softc *sc; struct gv_drive *d, *d2; struct gv_plex *p, *p2; @@ -560,6 +561,9 @@ gv_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp) */ LIST_FOREACH(d, &sc->drives, drive) { gp2 = d->geom; + cp = LIST_FIRST(&gp2->consumer); + if (cp != NULL) + g_access(cp, -1, -1, -1); if (gv_is_open(gp2)) return (EBUSY); } |