From: zhengyin Date: Mon, 11 Jun 2018 08:42:47 +0000 (+0800) Subject: rbd/resize: if new size is equal to original size, raise error X-Git-Tag: v14.0.1~873^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=30fa7fbbc08bf521204ce838768fdb552b73c2dd;p=ceph.git rbd/resize: if new size is equal to original size, raise error Signed-off-by: Zheng Yin zhengyin@cmss.chinamobile.com --- diff --git a/src/tools/rbd/action/Resize.cc b/src/tools/rbd/action/Resize.cc index aed5fdad1375..fdb3fcf0ac70 100644 --- a/src/tools/rbd/action/Resize.cc +++ b/src/tools/rbd/action/Resize.cc @@ -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()) { r = -EINVAL; } else {