]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: don't allow order to be more than 64
authorJosh Durgin <josh.durgin@inktank.com>
Mon, 24 Sep 2012 21:26:51 +0000 (14:26 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Tue, 25 Sep 2012 00:42:05 +0000 (17:42 -0700)
Otherwise it will overflow a uint64_t when shifting.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
src/librbd/internal.cc

index a376da10f333198d166d8353643d54c290cbeacd..2e5fefac95a5071a0932de26ac4beb7d58be6a46 100644 (file)
@@ -692,8 +692,8 @@ reprotect_and_return_err:
     if (!order)
       return -EINVAL;
 
-    if (*order && (*order > 255 || *order < 12)) {
-      lderr(cct) << "order must be in the range [12, 255]" << dendl;
+    if (*order && (*order > 64 || *order < 12)) {
+      lderr(cct) << "order must be in the range [12, 64]" << dendl;
       return -EDOM;
     }