diff options
author | pjd <pjd@FreeBSD.org> | 2004-07-31 00:51:33 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2004-07-31 00:51:33 +0000 |
commit | 8c9f26b7ea5ea9e9ecd17a9dbc6abb73549d694b (patch) | |
tree | 7c519a9d40123af549d29760b3e94285f04fac5c | |
parent | ecaa6b91a6c490e051236c10e13173a39150d88d (diff) | |
download | FreeBSD-src-8c9f26b7ea5ea9e9ecd17a9dbc6abb73549d694b.zip FreeBSD-src-8c9f26b7ea5ea9e9ecd17a9dbc6abb73549d694b.tar.gz |
- Check if 'slice' argument was given.
- Check if disk isn't already the mirror component.
-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 62d6b44..3685901 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); |