From a4d2a53cf6a952ee1e93c2a17e729da13644208f Mon Sep 17 00:00:00 2001 From: Xiaoxi Chen Date: Fri, 3 Apr 2015 09:48:43 +0800 Subject: [PATCH] Clear removed_collections after reap Previous code forgot to clear the removed_collections queues after reaped the collections in _reap_collection. Signed-off-by: Xiaoxi Chen --- src/os/newstore/NewStore.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/os/newstore/NewStore.cc b/src/os/newstore/NewStore.cc index 62a61f08e466f..e200c1f7df91a 100644 --- a/src/os/newstore/NewStore.cc +++ b/src/os/newstore/NewStore.cc @@ -1043,9 +1043,14 @@ void NewStore::_queue_reap_collection(CollectionRef& c) void NewStore::_reap_collections() { - Mutex::Locker l(reap_lock); - for (list::iterator p = removed_collections.begin(); - p != removed_collections.end(); + reap_lock.Lock(); + + list removed_colls; + removed_colls.swap(removed_collections); + reap_lock.Unlock(); + + for (list::iterator p = removed_colls.begin(); + p != removed_colls.end(); ++p) { CollectionRef c = *p; dout(10) << __func__ << " " << c->cid << dendl; -- 2.39.5