From 58075b5ab9e2b1eefa0656765cd623691f680679 Mon Sep 17 00:00:00 2001 From: le Date: Sat, 2 Oct 2004 20:50:21 +0000 Subject: Don't allow to create a drive that already exists. --- sys/geom/vinum/geom_vinum.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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)); -- cgit v1.1