diff options
author | le <le@FreeBSD.org> | 2004-10-02 20:50:21 +0000 |
---|---|---|
committer | le <le@FreeBSD.org> | 2004-10-02 20:50:21 +0000 |
commit | 58075b5ab9e2b1eefa0656765cd623691f680679 (patch) | |
tree | 50024d5deb680205bd1bddba28ddf3f674568750 /sys/geom/vinum | |
parent | 8ff45b174246a9f11538243c680820789ed17e3a (diff) | |
download | FreeBSD-src-58075b5ab9e2b1eefa0656765cd623691f680679.zip FreeBSD-src-58075b5ab9e2b1eefa0656765cd623691f680679.tar.gz |
Don't allow to create a drive that already exists.
Diffstat (limited to 'sys/geom/vinum')
-rw-r--r-- | sys/geom/vinum/geom_vinum.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/geom/vinum/geom_vinum.c b/sys/geom/vinum/geom_vinum.c index 5045345..a25e5ca 100644 --- a/sys/geom/vinum/geom_vinum.c +++ b/sys/geom/vinum/geom_vinum.c @@ -289,6 +289,14 @@ gv_create(struct g_geom *gp, struct gctl_req *req) for (i = 0; i < *drives; i++) { snprintf(buf, sizeof(buf), "drive%d", i); d2 = gctl_get_paraml(req, buf, sizeof(*d2)); + + d = gv_find_drive(sc, d2->name); + if (d != NULL) { + gctl_error(req, "drive '%s' is already known", + d->name); + continue; + } + d = g_malloc(sizeof(*d), M_WAITOK | M_ZERO); bcopy(d2, d, sizeof(*d)); |