diff options
author | pjd <pjd@FreeBSD.org> | 2004-08-28 02:02:48 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2004-08-28 02:02:48 +0000 |
commit | f7c5bbc8f201bba4e621d88934f609bcafa0f848 (patch) | |
tree | 41816e3c0485656f21643e02e86e0278656ec723 | |
parent | 9e60f4336ef9b844d4efc56ad86f56271fbaa726 (diff) | |
download | FreeBSD-src-f7c5bbc8f201bba4e621d88934f609bcafa0f848.zip FreeBSD-src-f7c5bbc8f201bba4e621d88934f609bcafa0f848.tar.gz |
Don't allow to insert providers, which are too small.
Reported by: Michael Handler <handler@grendel.net>
-rw-r--r-- | sys/geom/raid3/g_raid3_ctl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/geom/raid3/g_raid3_ctl.c b/sys/geom/raid3/g_raid3_ctl.c index d4a20c0..8fa6726 100644 --- a/sys/geom/raid3/g_raid3_ctl.c +++ b/sys/geom/raid3/g_raid3_ctl.c @@ -390,6 +390,10 @@ g_raid3_ctl_insert(struct gctl_req *req, struct g_class *mp) gctl_error(req, "Invalid provider."); return; } + if ((sc->sc_mediasize / (sc->sc_ndisks - 1)) > pp->mediasize) { + gctl_error(req, "Provider %s too small.", pp->name); + return; + } if (((sc->sc_sectorsize / (sc->sc_ndisks - 1)) % pp->sectorsize) != 0) { gctl_error(req, "Cannot insert provider %s, because of its sector size.", |