]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: destination pool should be source pool if it is not specified 13189/head
authorGaurav Kumar Garg <garg.gaurav52@gmail.com>
Mon, 30 Jan 2017 12:03:20 +0000 (13:03 +0100)
committerGaurav Kumar Garg <garg.gaurav52@gmail.com>
Wed, 1 Feb 2017 09:20:39 +0000 (10:20 +0100)
Currently if user perform image rename operation and user give pool
name as a optional parameter (--pool=<pool_name>) then currently
its taking this optional pool name for source pool and making
destination pool name default pool name.
With this fix if user provide pool name as a optional pool name
parameter then it  will consider both soruce and destination pool
name as optional parameter pool name.

Fixes: http://tracker.ceph.com/issues/18326
Reported-by: МАРК КОРЕНБЕРГ <socketpair@gmail.com>
Signed-off-by: Gaurav Kumar Garg <garg.gaurav52@gmail.com>
qa/workunits/rbd/copy.sh
src/tools/rbd/action/Rename.cc

index 746dd389b2437c099afac90c32735dab995a07fd..68778c1483790d2e5e051e5f04c76ee8c7d7efaf 100755 (executable)
@@ -95,7 +95,8 @@ test_rename() {
     rbd create -p rbd2 -s 1 foo
     rbd rename rbd2/foo rbd2/bar
     rbd -p rbd2 ls | grep bar
-    ! rbd rename rbd2/bar foo
+    rbd rename rbd2/bar foo
+    rbd rename --pool rbd2 foo bar
     ! rbd rename rbd2/bar --dest-pool rbd foo
     rbd rename --pool rbd2 bar --dest-pool rbd2 foo
     rbd -p rbd2 ls | grep foo
index 925a419e5e041366729485d1da86950933d46d91..3e2c336bc300fb3fd6338ee548aef6c238057af2 100644 (file)
@@ -42,9 +42,9 @@ int execute(const po::variables_map &vm) {
     return r;
   }
 
-  std::string dst_pool_name;
   std::string dst_image_name;
   std::string dst_snap_name;
+  std::string dst_pool_name = pool_name;
   r = utils::get_pool_image_snapshot_names(
     vm, at::ARGUMENT_MODIFIER_DEST, &arg_index, &dst_pool_name, &dst_image_name,
     &dst_snap_name, utils::SNAPSHOT_PRESENCE_NONE, utils::SPEC_VALIDATION_FULL);