From f68e60ea6cee95e459535d54947d119b40e0af3c Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Thu, 3 Apr 2014 21:08:03 +0800 Subject: [PATCH] ObjectCacher: assert no waiter when remove buffer head Signed-off-by: Yan, Zheng --- src/osdc/ObjectCacher.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc index 33bba06d5e5..3e41a5c5ba0 100644 --- a/src/osdc/ObjectCacher.cc +++ b/src/osdc/ObjectCacher.cc @@ -443,6 +443,7 @@ void ObjectCacher::Object::truncate(loff_t s) // remove bh entirely assert(bh->start() >= s); + assert(bh->waitfor_read.empty()); oc->bh_remove(this, bh); delete bh; } @@ -482,6 +483,7 @@ void ObjectCacher::Object::discard(loff_t off, loff_t len) ++p; ldout(oc->cct, 10) << "discard " << *this << " bh " << *bh << dendl; + assert(bh->waitfor_read.empty()); oc->bh_remove(this, bh); delete bh; } -- 2.47.3