]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd/resize: if new size is equal to original size, raise error 22637/head
authorzhengyin <zhengyin@cmss.chinamobile.com>
Mon, 11 Jun 2018 08:42:47 +0000 (16:42 +0800)
committerzhengyin <zhengyin@huayun.com>
Mon, 25 Jun 2018 15:04:36 +0000 (23:04 +0800)
Signed-off-by: Zheng Yin zhengyin@cmss.chinamobile.com
src/tools/rbd/action/Resize.cc

index aed5fdad137527dea4bf4f48ba22319b03d597e3..fdb3fcf0ac701268ff5880d77e97c597ba48af01 100644 (file)
@@ -71,6 +71,11 @@ int execute(const po::variables_map &vm,
     return r;
   }
 
+  if (info.size == size) {
+    std::cerr << "rbd: new size is equal to original size " << std::endl;
+    return -EINVAL;
+  }
+
   if (info.size > size && !vm["allow-shrink"].as<bool>()) {
     r = -EINVAL;
   } else {