Sector size can not be greater than MAXPHYS.

MFC after:	1 week
This commit is contained in:
ae 2011-01-12 12:26:10 +00:00
parent 61101fdbf7
commit e2bf490883

View File

@ -176,6 +176,10 @@ g_nop_create(struct gctl_req *req, struct g_class *mp, struct g_provider *pp,
gctl_error(req, "Invalid secsize for provider %s.", pp->name);
return (EINVAL);
}
if (secsize > MAXPHYS) {
gctl_error(req, "secsize is too big.");
return (EINVAL);
}
size -= size % secsize;
snprintf(name, sizeof(name), "%s%s", pp->name, G_NOP_SUFFIX);
LIST_FOREACH(gp, &mp->geom, geom) {