Skip to content

Commit

Permalink
Treat rename across pools as an error
Browse files Browse the repository at this point in the history
Fixes: ceph#2370
Reviewed-by: Samuel Just <[email protected]>
  • Loading branch information
Dan Mick committed May 2, 2012
1 parent 2a93258 commit ee26c5d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion man/rbd.8
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions src/rbd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ee26c5d

Please sign in to comment.