From 1fe54bfefe13f54ad1e46666cc5a6a076baee11a Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Thu, 25 Aug 2011 08:41:40 -0700 Subject: [PATCH] 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 --- src/os/FileStore.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 6ea03cfbb8f22..c5d63a5149b39 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -3715,8 +3715,11 @@ int FileStore::_collection_setattrs(coll_t cid, map& 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 << "'" -- 2.39.5