summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2015-12-02 13:19:51 +1100
committerMichael Cahill <michael.cahill@mongodb.com>2015-12-02 13:19:51 +1100
commit5fe8c70e33731e0a6d5d25d2883faa52916f8dcf (patch)
tree34111078f1dc1e2c1886a48be272b64fa3bf8463
parent745eb56977bb7b636572d7eb8e7b1619f561bbb3 (diff)
downloadmongo-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.c8
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.
*