diff options
author | Luke Chen <luke.chen@mongodb.com> | 2021-11-15 17:17:15 +1100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-11-15 06:45:10 +0000 |
commit | bf73aa9e17d57086333ae545e02dd9172a14c944 (patch) | |
tree | 4f2cea5fae5272ce99adf13f1534267d06e4b9fb /src/third_party/wiredtiger/src/btree | |
parent | 15f9f75e1e627486aaa927a23f9f5a3eb9721114 (diff) | |
download | mongo-bf73aa9e17d57086333ae545e02dd9172a14c944.tar.gz |
Import wiredtiger: 180c9bfa728620b9e59399eb49dc9e837539f8aa from branch mongodb-master
ref: d651799004..180c9bfa72
for: 5.2.0
WT-8340 Fix overflowed value in Btree atomic flags of 8 bit type
Diffstat (limited to 'src/third_party/wiredtiger/src/btree')
-rw-r--r-- | src/third_party/wiredtiger/src/btree/bt_compact.c | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/btree/bt_debug.c | 14 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/btree/bt_discard.c | 10 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/btree/bt_page.c | 6 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/btree/bt_split.c | 8 |
5 files changed, 20 insertions, 20 deletions
diff --git a/src/third_party/wiredtiger/src/btree/bt_compact.c b/src/third_party/wiredtiger/src/btree/bt_compact.c index 242b1c3d77b..b542544abef 100644 --- a/src/third_party/wiredtiger/src/btree/bt_compact.c +++ b/src/third_party/wiredtiger/src/btree/bt_compact.c @@ -83,7 +83,7 @@ __compact_page_inmem(WT_SESSION_IMPL *session, WT_REF *ref, bool *skipp) /* If rewriting the page, have reconciliation write new blocks. */ if (!*skipp) - F_SET_ATOMIC(ref->page, WT_PAGE_COMPACTION_WRITE); + F_SET_ATOMIC_16(ref->page, WT_PAGE_COMPACTION_WRITE); return (0); } diff --git a/src/third_party/wiredtiger/src/btree/bt_debug.c b/src/third_party/wiredtiger/src/btree/bt_debug.c index f6d4fb0de1c..0a80311a159 100644 --- a/src/third_party/wiredtiger/src/btree/bt_debug.c +++ b/src/third_party/wiredtiger/src/btree/bt_debug.c @@ -1120,19 +1120,19 @@ __debug_page_metadata(WT_DBG *ds, WT_REF *ref) WT_RET(ds->f(ds, ", entries %" PRIu32, entries)); WT_RET(ds->f(ds, ", %s", __wt_page_is_modified(page) ? "dirty" : "clean")); - if (F_ISSET_ATOMIC(page, WT_PAGE_BUILD_KEYS)) + if (F_ISSET_ATOMIC_16(page, WT_PAGE_BUILD_KEYS)) WT_RET(ds->f(ds, ", keys-built")); - if (F_ISSET_ATOMIC(page, WT_PAGE_DISK_ALLOC)) + if (F_ISSET_ATOMIC_16(page, WT_PAGE_DISK_ALLOC)) WT_RET(ds->f(ds, ", disk-alloc")); - if (F_ISSET_ATOMIC(page, WT_PAGE_DISK_MAPPED)) + if (F_ISSET_ATOMIC_16(page, WT_PAGE_DISK_MAPPED)) WT_RET(ds->f(ds, ", disk-mapped")); - if (F_ISSET_ATOMIC(page, WT_PAGE_EVICT_LRU)) + if (F_ISSET_ATOMIC_16(page, WT_PAGE_EVICT_LRU)) WT_RET(ds->f(ds, ", evict-lru")); - if (F_ISSET_ATOMIC(page, WT_PAGE_INTL_OVERFLOW_KEYS)) + if (F_ISSET_ATOMIC_16(page, WT_PAGE_INTL_OVERFLOW_KEYS)) WT_RET(ds->f(ds, ", overflow-keys")); - if (F_ISSET_ATOMIC(page, WT_PAGE_SPLIT_INSERT)) + if (F_ISSET_ATOMIC_16(page, WT_PAGE_SPLIT_INSERT)) WT_RET(ds->f(ds, ", split-insert")); - if (F_ISSET_ATOMIC(page, WT_PAGE_UPDATE_IGNORE)) + if (F_ISSET_ATOMIC_16(page, WT_PAGE_UPDATE_IGNORE)) WT_RET(ds->f(ds, ", update-ignore")); if (mod != NULL) diff --git a/src/third_party/wiredtiger/src/btree/bt_discard.c b/src/third_party/wiredtiger/src/btree/bt_discard.c index 2e8e333f9e6..d94bef594bb 100644 --- a/src/third_party/wiredtiger/src/btree/bt_discard.c +++ b/src/third_party/wiredtiger/src/btree/bt_discard.c @@ -74,7 +74,7 @@ __wt_page_out(WT_SESSION_IMPL *session, WT_PAGE **pagep) /* Assert we never discard a dirty page or a page queue for eviction. */ WT_ASSERT(session, !__wt_page_is_modified(page)); - WT_ASSERT(session, !F_ISSET_ATOMIC(page, WT_PAGE_EVICT_LRU)); + WT_ASSERT(session, !F_ISSET_ATOMIC_16(page, WT_PAGE_EVICT_LRU)); /* * If a root page split, there may be one or more pages linked from the page; walk the list, @@ -93,11 +93,11 @@ __wt_page_out(WT_SESSION_IMPL *session, WT_PAGE **pagep) __wt_cache_page_evict(session, page); dsk = (WT_PAGE_HEADER *)page->dsk; - if (F_ISSET_ATOMIC(page, WT_PAGE_DISK_ALLOC)) + if (F_ISSET_ATOMIC_16(page, WT_PAGE_DISK_ALLOC)) __wt_cache_page_image_decr(session, page); /* Discard any mapped image. */ - if (F_ISSET_ATOMIC(page, WT_PAGE_DISK_MAPPED)) + if (F_ISSET_ATOMIC_16(page, WT_PAGE_DISK_MAPPED)) (void)S2BT(session)->bm->map_discard( S2BT(session)->bm, session, dsk, (size_t)dsk->mem_size); @@ -128,7 +128,7 @@ __wt_page_out(WT_SESSION_IMPL *session, WT_PAGE **pagep) } /* Discard any allocated disk image. */ - if (F_ISSET_ATOMIC(page, WT_PAGE_DISK_ALLOC)) + if (F_ISSET_ATOMIC_16(page, WT_PAGE_DISK_ALLOC)) __wt_overwrite_and_free_len(session, dsk, dsk->mem_size); __wt_overwrite_and_free(session, page); @@ -150,7 +150,7 @@ __free_page_modify(WT_SESSION_IMPL *session, WT_PAGE *page) mod = page->modify; /* In some failed-split cases, we can't discard updates. */ - update_ignore = F_ISSET_ATOMIC(page, WT_PAGE_UPDATE_IGNORE); + update_ignore = F_ISSET_ATOMIC_16(page, WT_PAGE_UPDATE_IGNORE); switch (mod->rec_result) { case WT_PM_REC_MULTIBLOCK: diff --git a/src/third_party/wiredtiger/src/btree/bt_page.c b/src/third_party/wiredtiger/src/btree/bt_page.c index 9e330f31118..70cc874b2e9 100644 --- a/src/third_party/wiredtiger/src/btree/bt_page.c +++ b/src/third_party/wiredtiger/src/btree/bt_page.c @@ -361,7 +361,7 @@ __wt_page_inmem(WT_SESSION_IMPL *session, WT_REF *ref, const void *image, uint32 /* Allocate and initialize a new WT_PAGE. */ WT_RET(__wt_page_alloc(session, dsk->type, alloc_entries, true, &page)); page->dsk = dsk; - F_SET_ATOMIC(page, flags); + F_SET_ATOMIC_16(page, flags); /* * Track the memory allocated to build this page so we can update the cache statistics in a @@ -664,7 +664,7 @@ __inmem_row_int(WT_SESSION_IMPL *session, WT_PAGE *page, size_t *sizep) * writes overflow cookies on internal pages, no matter the size of the key.) */ if (overflow_keys) - F_SET_ATOMIC(page, WT_PAGE_INTL_OVERFLOW_KEYS); + F_SET_ATOMIC_16(page, WT_PAGE_INTL_OVERFLOW_KEYS); err: __wt_scr_free(session, ¤t); @@ -852,7 +852,7 @@ __inmem_row_leaf(WT_SESSION_IMPL *session, WT_PAGE *page, bool *preparedp) * Mark the page as not needing that work if there aren't stretches of prefix-compressed keys. */ if (best_prefix_count <= 10) - F_SET_ATOMIC(page, WT_PAGE_BUILD_KEYS); + F_SET_ATOMIC_16(page, WT_PAGE_BUILD_KEYS); if (preparedp != NULL && prepare) *preparedp = true; diff --git a/src/third_party/wiredtiger/src/btree/bt_split.c b/src/third_party/wiredtiger/src/btree/bt_split.c index 54fc452bd49..7ea22ded8db 100644 --- a/src/third_party/wiredtiger/src/btree/bt_split.c +++ b/src/third_party/wiredtiger/src/btree/bt_split.c @@ -160,7 +160,7 @@ __split_ovfl_key_cleanup(WT_SESSION_IMPL *session, WT_PAGE *page, WT_REF *ref) uint32_t cell_offset; /* There's a per-page flag if there are any overflow keys at all. */ - if (!F_ISSET_ATOMIC(page, WT_PAGE_INTL_OVERFLOW_KEYS)) + if (!F_ISSET_ATOMIC_16(page, WT_PAGE_INTL_OVERFLOW_KEYS)) return (0); /* @@ -1613,7 +1613,7 @@ __split_multi_inmem_fail(WT_SESSION_IMPL *session, WT_PAGE *orig, WT_MULTI *mult */ if (ref != NULL) { if (ref->page != NULL) - F_SET_ATOMIC(ref->page, WT_PAGE_UPDATE_IGNORE); + F_SET_ATOMIC_16(ref->page, WT_PAGE_UPDATE_IGNORE); __wt_free_ref(session, ref, orig->type, true); } } @@ -1747,7 +1747,7 @@ __split_insert(WT_SESSION_IMPL *session, WT_REF *ref) WT_ASSERT(session, __wt_page_is_modified(page)); WT_ASSERT(session, ref->ft_info.del == NULL); - F_SET_ATOMIC(page, WT_PAGE_SPLIT_INSERT); /* Only split in-memory once. */ + F_SET_ATOMIC_16(page, WT_PAGE_SPLIT_INSERT); /* Only split in-memory once. */ /* Find the last item on the page. */ if (type == WT_PAGE_ROW_LEAF) @@ -2238,7 +2238,7 @@ __wt_split_rewrite(WT_SESSION_IMPL *session, WT_REF *ref, WT_MULTI *multi) */ __wt_page_modify_clear(session, page); if (!F_ISSET(S2C(session)->cache, WT_CACHE_EVICT_SCRUB) || multi->supd_restore) - F_SET_ATOMIC(page, WT_PAGE_EVICT_NO_PROGRESS); + F_SET_ATOMIC_16(page, WT_PAGE_EVICT_NO_PROGRESS); __wt_ref_out(session, ref); /* Swap the new page into place. */ |