aboutsummaryrefslogtreecommitdiff
path: root/sys/geom/vinum
diff options
context:
space:
mode:
authorLukas Ertl <le@FreeBSD.org>2004-10-02 20:50:21 +0000
committerLukas Ertl <le@FreeBSD.org>2004-10-02 20:50:21 +0000
commit4cb1b18827456c5fcc25802a90320ddd7f903c43 (patch)
tree50024d5deb680205bd1bddba28ddf3f674568750 /sys/geom/vinum
parentd9d3a74c874c5d335992a0e0a2530ceae2235949 (diff)
downloadsrc-4cb1b18827456c5fcc25802a90320ddd7f903c43.tar.gz
src-4cb1b18827456c5fcc25802a90320ddd7f903c43.zip
Don't allow to create a drive that already exists.
Notes
Notes: svn path=/head/; revision=136065
Diffstat (limited to 'sys/geom/vinum')
-rw-r--r--sys/geom/vinum/geom_vinum.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/geom/vinum/geom_vinum.c b/sys/geom/vinum/geom_vinum.c
index 50453455e508..a25e5cafd632 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));