Don't allow to insert providers, which are too small.

Reported by:	Michael Handler <handler@grendel.net>
This commit is contained in:
pjd 2004-08-28 02:02:48 +00:00
parent 9e60f4336e
commit f7c5bbc8f2

View File

@ -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.",