summaryrefslogtreecommitdiff
path: root/src/os/FileStore.cc
diff options
context:
space:
mode:
authorSamuel Just <rexludorum@gmail.com>2011-08-25 08:41:40 -0700
committerSamuel Just <samuel.just@dreamhost.com>2011-08-29 17:42:51 -0700
commit1fe54bfefe13f54ad1e46666cc5a6a076baee11a (patch)
tree4b96234cb928b1885d7b5eeb5652a9b7a2ad805f /src/os/FileStore.cc
parent30856dc18eab7752effb0139189560dd1bc1ec00 (diff)
downloadceph-1fe54bfefe13f54ad1e46666cc5a6a076baee11a.tar.gz
FileStore.cc: Fix error in collection_rename
Previously, the rename operated on the collection names. Now, rename operations on the full paths to the collections. Signed-off-by: Samuel Just <rexludorum@gmail.com>
Diffstat (limited to 'src/os/FileStore.cc')
-rw-r--r--src/os/FileStore.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc
index 6ea03cfbb8f..c5d63a5149b 100644
--- a/src/os/FileStore.cc
+++ b/src/os/FileStore.cc
@@ -3715,8 +3715,11 @@ int FileStore::_collection_setattrs(coll_t cid, map<string,bufferptr>& aset)
int FileStore::_collection_rename(const coll_t &cid, const coll_t &ncid)
{
+ char new_coll[PATH_MAX], old_coll[PATH_MAX];
+ get_cdir(cid, old_coll, sizeof(old_coll));
+ get_cdir(ncid, new_coll, sizeof(new_coll));
int ret = 0;
- if (::rename(cid.c_str(), ncid.c_str())) {
+ if (::rename(old_coll, new_coll)) {
ret = errno;
}
dout(10) << "collection_rename '" << cid << "' to '" << ncid << "'"