]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Clear removed_collections after reap
authorXiaoxi Chen <xiaoxi.chen@intel.com>
Fri, 3 Apr 2015 01:48:43 +0000 (09:48 +0800)
committerSage Weil <sage@redhat.com>
Tue, 1 Sep 2015 17:39:36 +0000 (13:39 -0400)
Previous code forgot to clear the removed_collections queues
after reaped the collections in _reap_collection.

Signed-off-by: Xiaoxi Chen <xiaoxi.chen@intel.com>
src/os/newstore/NewStore.cc

index 62a61f08e466f9cc7eaa9a09fc3603bc2cee8298..e200c1f7df91afd11a0add6a5f86dd3caf710cce 100644 (file)
@@ -1043,9 +1043,14 @@ void NewStore::_queue_reap_collection(CollectionRef& c)
 
 void NewStore::_reap_collections()
 {
-  Mutex::Locker l(reap_lock);
-  for (list<CollectionRef>::iterator p = removed_collections.begin();
-       p != removed_collections.end();
+  reap_lock.Lock();
+
+  list<CollectionRef> removed_colls;
+  removed_colls.swap(removed_collections);
+  reap_lock.Unlock();
+
+  for (list<CollectionRef>::iterator p = removed_colls.begin();
+       p != removed_colls.end();
        ++p) {
     CollectionRef c = *p;
     dout(10) << __func__ << " " << c->cid << dendl;