diff options
author | le <le@FreeBSD.org> | 2004-07-25 23:01:09 +0000 |
---|---|---|
committer | le <le@FreeBSD.org> | 2004-07-25 23:01:09 +0000 |
commit | d360d6d42fa54bc605cba0bffb8e1ff8d6f191f7 (patch) | |
tree | d9966e1e68f6b1367eb38bffba1662cba63bf7a2 /sys | |
parent | 88dbff160e2d51e24123d456b323e9ec9cda7ea8 (diff) | |
download | FreeBSD-src-d360d6d42fa54bc605cba0bffb8e1ff8d6f191f7.zip FreeBSD-src-d360d6d42fa54bc605cba0bffb8e1ff8d6f191f7.tar.gz |
There's a chance that the VINUMDRIVE class tastes before the
VINUM class, so let the VINUMDRIVE class parse the on-disk
configuration, too.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/geom/vinum/geom_vinum_drive.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/geom/vinum/geom_vinum_drive.c b/sys/geom/vinum/geom_vinum_drive.c index 86eec15..a7fa0d6 100644 --- a/sys/geom/vinum/geom_vinum_drive.c +++ b/sys/geom/vinum/geom_vinum_drive.c @@ -313,7 +313,7 @@ gv_drive_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) struct gv_freelist *fl; struct gv_hdr *vhdr; int error; - char errstr[ERRBUFSIZ]; + char *buf, errstr[ERRBUFSIZ]; vhdr = NULL; d = NULL; @@ -357,8 +357,19 @@ gv_drive_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) /* * We have found a valid vinum drive. Let's see if it is - * already known in the configuration. + * already known in the configuration. There's a chance that + * the VINUMDRIVE class tastes before the VINUM class could + * taste, so parse the configuration here too, just to be on + * the safe side. */ + buf = g_read_data(cp, GV_CFG_OFFSET, GV_CFG_LEN, &error); + if (buf == NULL || error != 0) { + g_free(vhdr); + break; + } + gv_parse_config(sc, buf, 1); + g_free(buf); + g_topology_lock(); g_access(cp, -1, 0, 0); g_detach(cp); |