diff options
author | ae <ae@FreeBSD.org> | 2011-01-12 12:26:10 +0000 |
---|---|---|
committer | ae <ae@FreeBSD.org> | 2011-01-12 12:26:10 +0000 |
commit | e2bf490883981ea8ba474ce9e80082abcb542607 (patch) | |
tree | 2d67e8a9476cf411b28f26df394d21cc5d9c53fe | |
parent | 61101fdbf73578612983b8ab2905fdd9a3dbc215 (diff) | |
download | FreeBSD-src-e2bf490883981ea8ba474ce9e80082abcb542607.zip FreeBSD-src-e2bf490883981ea8ba474ce9e80082abcb542607.tar.gz |
Sector size can not be greater than MAXPHYS.
MFC after: 1 week
-rw-r--r-- | sys/geom/nop/g_nop.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/geom/nop/g_nop.c b/sys/geom/nop/g_nop.c index 67161cc..9846942 100644 --- a/sys/geom/nop/g_nop.c +++ b/sys/geom/nop/g_nop.c @@ -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) { |