]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Treat rename across pools as an error
authorDan Mick <dan.mick@dreamhost.com>
Tue, 1 May 2012 22:33:19 +0000 (15:33 -0700)
committerDan Mick <dan.mick@dreamhost.com>
Wed, 2 May 2012 03:08:00 +0000 (20:08 -0700)
Fixes: #2370
Reviewed-by: Samuel Just <samuel.just@dreamhost.com>
man/rbd.8
src/rbd.cc

index ff20f034ff5f0ed78faa1b6591b036790c5f7d43..82171a9e5995cb0be953b7bf8e512e49b391d627 100644 (file)
--- a/man/rbd.8
+++ b/man/rbd.8
@@ -116,7 +116,7 @@ Creates a new image and imports its data from path.
 Copies the content of a src\-image into the newly created dest\-image.
 .TP
 .B \fBmv\fP [\fIsrc\-image\fP] [\fIdest\-image\fP]
-Renames an image.
+Renames an image.  Note: rename across pools is unsupported.
 .TP
 .B \fBsnap\fP ls [\fIimage\-name\fP]
 Dumps the list of snapshots inside a specific image.
index 1c43fb544be9d0f0f0eff466e0c39c077f13dd7c..655d9a2918c9481295d7624424ef6632ddd149bb 100644 (file)
@@ -1090,6 +1090,13 @@ int main(int argc, const char **argv)
     usage_exit();
   }
 
+  if ((opt_cmd == OPT_RENAME) && (strcmp(poolname, dest_poolname) != 0)) {
+    cerr << "error: mv/rename across pools not supported" << std::endl;
+    cerr << "source pool: " << poolname << " dest pool: " << dest_poolname
+      << std::endl;
+    exit(EXIT_FAILURE);
+  }
+
   bool talk_to_cluster = (opt_cmd != OPT_MAP &&
                          opt_cmd != OPT_UNMAP &&
                          opt_cmd != OPT_SHOWMAPPED);