From: Dan Mick Date: Tue, 1 May 2012 22:33:19 +0000 (-0700) Subject: Treat rename across pools as an error X-Git-Tag: v0.47~62 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ee26c5d73a48b64292d16a87ebe69908c142048e;p=ceph.git Treat rename across pools as an error Fixes: #2370 Reviewed-by: Samuel Just --- diff --git a/man/rbd.8 b/man/rbd.8 index ff20f034ff5f..82171a9e5995 100644 --- 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. diff --git a/src/rbd.cc b/src/rbd.cc index 1c43fb544be9..655d9a2918c9 100644 --- a/src/rbd.cc +++ b/src/rbd.cc @@ -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);