From: Sage Weil Date: Tue, 23 Oct 2012 16:18:04 +0000 (-0700) Subject: osdc/ObjectCacher: check lru_is_expireable() in can_close() X-Git-Tag: v0.55~130^2~55^2^2~16 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f241e22f529c60b9563770f61f5cdadccfff5d79;p=ceph.git osdc/ObjectCacher: check lru_is_expireable() in can_close() We assert that if can_close(), the Object isn't pinned in the LRU. This assumes we did yur get/put refcounting properly, such that the pins are at least as restrictive as can_close(). Signed-off-by: Sage Weil --- diff --git a/src/osdc/ObjectCacher.h b/src/osdc/ObjectCacher.h index 09fb17cb42ed..ac17c4f8daca 100644 --- a/src/osdc/ObjectCacher.h +++ b/src/osdc/ObjectCacher.h @@ -225,10 +225,14 @@ class ObjectCacher { void set_object_locator(object_locator_t& l) { oloc = l; } bool can_close() { - return data.empty() && lock_state == LOCK_NONE && - waitfor_commit.empty() && - waitfor_rd.empty() && waitfor_wr.empty() && - dirty_or_tx == 0; + if (data.empty() && lock_state == LOCK_NONE && + waitfor_commit.empty() && + waitfor_rd.empty() && waitfor_wr.empty() && + dirty_or_tx == 0) { + assert(lru_is_expireable()); + return true; + } + return false; } /**