From e2d50a774becf2f085919a3816b5273cc813847c Mon Sep 17 00:00:00 2001 From: Shiyang Ruan Date: Fri, 2 Nov 2018 17:51:41 +0800 Subject: [PATCH] rbd: return error code when the source and distination namespace are different. Signed-off-by: Shiyang Ruan --- src/tools/rbd/action/Snap.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/rbd/action/Snap.cc b/src/tools/rbd/action/Snap.cc index 9f49f1d4e356..70cf62dab0cc 100644 --- a/src/tools/rbd/action/Snap.cc +++ b/src/tools/rbd/action/Snap.cc @@ -828,6 +828,7 @@ int execute_rename(const po::variables_map &vm, } else if (namespace_name != dest_namespace_name) { std::cerr << "rbd: source and destination namespace must be the same" << std::endl; + return -EINVAL; } else if (image_name != dest_image_name) { std::cerr << "rbd: source and destination image name must be the same" << std::endl; -- 2.47.3