Skip to content

Commit 3303f86

Browse files
committed
crimson/os/seastore/linked_tree_node: set reserved_ptr to an 8-byte
aligned address Maybe we shouldn't be using an instant integer as the invalid pointer. Fixes: https://tracker.ceph.com/issues/70202 Signed-off-by: Xuehan Xu <[email protected]>
1 parent 1bc1c5e commit 3303f86

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/crimson/os/seastore/linked_tree_node.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,10 @@ class BaseChildNode {
217217
// indirect mapping.
218218
template <typename T, typename node_key_t>
219219
inline BaseChildNode<T, node_key_t>* get_reserved_ptr() {
220-
return (BaseChildNode<T, node_key_t>*)0x1;
220+
//TODO: using instant integers as invalid pointers may
221+
// not be a good practice.
222+
constexpr uint64_t reserved_ptr = std::numeric_limits<size_t>::max() - 15;
223+
return (BaseChildNode<T, node_key_t>*)reserved_ptr;
221224
}
222225

223226
template <typename T, typename node_key_t>

0 commit comments

Comments
 (0)