]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/linked_tree_node: set reserved_ptr to an 8-byte 62084/head
authorXuehan Xu <xuxuehan@qianxin.com>
Mon, 3 Mar 2025 10:07:25 +0000 (18:07 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Wed, 5 Mar 2025 01:37:35 +0000 (09:37 +0800)
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 <xuxuehan@qianxin.com>
src/crimson/os/seastore/linked_tree_node.h

index 4f8e52bea17c0b4df5c3f2f9a2ee47b1f19b25fd..76be226ebb725adb3faf69eb39785c869d199d97 100644 (file)
@@ -217,7 +217,10 @@ protected:
 // indirect mapping.
 template <typename T, typename node_key_t>
 inline BaseChildNode<T, node_key_t>* get_reserved_ptr() {
-  return (BaseChildNode<T, node_key_t>*)0x1;
+  //TODO: using instant integers as invalid pointers may
+  //     not be a good practice.
+  constexpr uint64_t reserved_ptr = std::numeric_limits<size_t>::max() - 15;
+  return (BaseChildNode<T, node_key_t>*)reserved_ptr;
 }
 
 template <typename T, typename node_key_t>