From: Sage Weil Date: Sat, 26 Oct 2013 00:45:06 +0000 (-0700) Subject: mon/OSDMonitor: make racing dup pool rename behave X-Git-Tag: v0.72-rc1~12^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F765%2Fhead;p=ceph.git mon/OSDMonitor: make racing dup pool rename behave If we get dup pool rename requests that are racing, make sure the second one comes back with 'success' if the rename entry already exists in the pending_inc map. Signed-off-by: Sage Weil --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 53f2e9491c7..14a5d704071 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -4348,7 +4348,7 @@ int OSDMonitor::_prepare_rename_pool(uint64_t pool, string newname) for (map::iterator p = pending_inc.new_pool_names.begin(); p != pending_inc.new_pool_names.end(); ++p) { - if (p->second == newname) { + if (p->second == newname && p->first != pool) { return -EEXIST; } }