]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fix dup pool creation race
authorSage Weil <sage@newdream.net>
Mon, 26 Sep 2011 23:25:04 +0000 (16:25 -0700)
committerSage Weil <sage@newdream.net>
Mon, 26 Sep 2011 23:25:04 +0000 (16:25 -0700)
Fixes: #1574
Signed-off-by: Sage Weil <sage@newdream.net>
src/mon/OSDMonitor.cc

index d66a53fe60677d741fd9ac76ceab82a50eec63e6..db5120c1d643d7251e025620f1334c11d387c0a4 100644 (file)
@@ -1349,9 +1349,11 @@ int OSDMonitor::prepare_new_pool(MPoolOp *m)
 
 int OSDMonitor::prepare_new_pool(string& name, uint64_t auid, int crush_rule)
 {
-  if (osdmap.name_pool.count(name)) {
+  if (osdmap.name_pool.count(name) ||
+      pending_inc.new_pool_names.count(name)) {
     return -EEXIST;
   }
+
   if (-1 == pending_inc.new_pool_max)
     pending_inc.new_pool_max = osdmap.pool_max;
   int64_t pool = ++pending_inc.new_pool_max;