diff options
author | Michael Cahill <michael.cahill@mongodb.com> | 2015-12-02 13:19:51 +1100 |
---|---|---|
committer | Michael Cahill <michael.cahill@mongodb.com> | 2015-12-02 13:19:51 +1100 |
commit | 5fe8c70e33731e0a6d5d25d2883faa52916f8dcf (patch) | |
tree | 34111078f1dc1e2c1886a48be272b64fa3bf8463 | |
parent | 745eb56977bb7b636572d7eb8e7b1619f561bbb3 (diff) | |
download | mongo-5fe8c70e33731e0a6d5d25d2883faa52916f8dcf.tar.gz |
SERVER-21553 Check that ref->addr is NULL, don't try to free it.
During review of this change, noticed that we are trying to free an address in
a path where it should never be set (or we would leak blocks). Assert that the
address is NULL instead of checking whether it needs to be freed.
-rw-r--r-- | src/evict/evict_page.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/evict/evict_page.c b/src/evict/evict_page.c index e5ec2ad7a8c..1cdf07a9a55 100644 --- a/src/evict/evict_page.c +++ b/src/evict/evict_page.c @@ -245,11 +245,10 @@ __evict_page_dirty_update(WT_SESSION_IMPL *session, WT_REF *ref, bool closing) mod = ref->page->modify; + WT_ASSERT(session, ref->addr == NULL); + switch (mod->rec_result) { case WT_PM_REC_EMPTY: /* Page is empty */ - /* Discard the parent's address. */ - __wt_ref_addr_free(session, ref); - /* * Update the parent to reference a deleted page. The fact that * reconciliation left the page "empty" means there's no older @@ -302,9 +301,6 @@ __evict_page_dirty_update(WT_SESSION_IMPL *session, WT_REF *ref, bool closing) if (!closing && __wt_eviction_dirty_target(session)) return (EBUSY); - /* Discard the parent's address. */ - __wt_ref_addr_free(session, ref); - /* * Update the parent to reference the replacement page. * |