]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: restrict pool size to 1..10
authorSage Weil <sage@inktank.com>
Tue, 19 Feb 2013 16:29:53 +0000 (08:29 -0800)
committerSage Weil <sage@inktank.com>
Fri, 19 Apr 2013 21:33:33 +0000 (14:33 -0700)
See: #4159
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 30b8d653751acb4bc4be5ca611f154e19afe910a)

src/mon/OSDMonitor.cc

index 786ccd1929af5161f04662a8e915ddce0197215e..96be3ade370692b4c28389e69b758d198a272404 100644 (file)
@@ -2830,6 +2830,11 @@ bool OSDMonitor::prepare_command(MMonCommand *m)
          unsigned n = strtol(start, &end, 10);
          if (*end == '\0') {
            if (m->cmd[4] == "size") {
+             if (n == 0 || n > 10) {
+               ss << "pool size must be between 1 and 10";
+               err = -EINVAL;
+               goto out;
+             }
              if (pending_inc.new_pools.count(pool) == 0)
                pending_inc.new_pools[pool] = *p;
              pending_inc.new_pools[pool].size = n;