diff options
| author | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2004-07-31 00:51:33 +0000 |
|---|---|---|
| committer | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2004-07-31 00:51:33 +0000 |
| commit | ff9160f5f378604baf5de70e6b430407070aee2e (patch) | |
| tree | 7c519a9d40123af549d29760b3e94285f04fac5c | |
| parent | f251dfbf5dc877b6b4504005cb865f0de24d2c37 (diff) | |
Notes
| -rw-r--r-- | sys/geom/mirror/g_mirror_ctl.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/geom/mirror/g_mirror_ctl.c b/sys/geom/mirror/g_mirror_ctl.c index 62d6b44fcdff..36859010ffab 100644 --- a/sys/geom/mirror/g_mirror_ctl.c +++ b/sys/geom/mirror/g_mirror_ctl.c @@ -121,6 +121,10 @@ g_mirror_ctl_configure(struct gctl_req *req, struct g_class *mp) balance = balance_id(balancep); } slicep = gctl_get_paraml(req, "slice", sizeof(*slicep)); + if (slicep == NULL) { + gctl_error(req, "No '%s' argument.", "slice"); + return; + } if (*slicep == -1) slice = sc->sc_slice; else @@ -298,6 +302,10 @@ g_mirror_ctl_insert(struct gctl_req *req, struct g_class *mp) } if (strncmp(name, "/dev/", strlen("/dev/")) == 0) name += strlen("/dev/"); + if (g_mirror_find_disk(sc, name) != NULL) { + gctl_error(req, "Provider %s already inserted.", name); + continue; + } pp = g_provider_by_name(name); if (pp == NULL) { gctl_error(req, "Unknown provider %s.", name); |
