mirror of
https://github.com/ceph/ceph
synced 2025-02-24 03:27:10 +00:00
crimson/onode-staged-tree: fix unaligned reference to shard_pool_t::pool
../src/crimson/os/seastore/onode_manager/staged-fltree/stages/key_layout.h:844:44: runtime error: reference binding to misaligned address 0x6250013ee905 for type 'const crimson::os::seastore::onode::pool_t' (aka 'const long'), which requires 8 byte alignment from UndefinedBehaviorSanitizer Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
This commit is contained in:
parent
948dd1bb13
commit
74c853034e
@ -58,24 +58,26 @@ struct node_offset_packed_t {
|
||||
// TODO: consider alignments
|
||||
struct shard_pool_t {
|
||||
bool operator==(const shard_pool_t& x) const {
|
||||
return (shard == x.shard && pool == x.pool);
|
||||
return (shard == x.shard && pool() == x.pool());
|
||||
}
|
||||
bool operator!=(const shard_pool_t& x) const { return !(*this == x); }
|
||||
|
||||
pool_t pool() const { return _pool; }
|
||||
|
||||
template <KeyT KT>
|
||||
static shard_pool_t from_key(const full_key_t<KT>& key);
|
||||
|
||||
shard_t shard;
|
||||
pool_t pool;
|
||||
pool_t _pool;
|
||||
} __attribute__((packed));
|
||||
inline std::ostream& operator<<(std::ostream& os, const shard_pool_t& sp) {
|
||||
return os << (int)sp.shard << "," << sp.pool;
|
||||
return os << (int)sp.shard << "," << sp.pool();
|
||||
}
|
||||
inline MatchKindCMP compare_to(const shard_pool_t& l, const shard_pool_t& r) {
|
||||
auto ret = toMatchKindCMP(l.shard, r.shard);
|
||||
if (ret != MatchKindCMP::EQ)
|
||||
return ret;
|
||||
return toMatchKindCMP(l.pool, r.pool);
|
||||
return toMatchKindCMP(l.pool(), r.pool());
|
||||
}
|
||||
|
||||
// Note: this is the reversed version of the object hash
|
||||
@ -621,7 +623,7 @@ class key_view_t {
|
||||
return shard_pool_packed().shard;
|
||||
}
|
||||
pool_t pool() const {
|
||||
return shard_pool_packed().pool;
|
||||
return shard_pool_packed().pool();
|
||||
}
|
||||
crush_hash_t crush() const {
|
||||
return crush_packed().crush;
|
||||
@ -841,7 +843,7 @@ MatchKindCMP compare_to(const full_key_t<Type>& key, const shard_pool_t& target)
|
||||
auto ret = toMatchKindCMP(key.shard(), target.shard);
|
||||
if (ret != MatchKindCMP::EQ)
|
||||
return ret;
|
||||
return toMatchKindCMP(key.pool(), target.pool);
|
||||
return toMatchKindCMP(key.pool(), target.pool());
|
||||
}
|
||||
|
||||
template <KeyT Type>
|
||||
|
Loading…
Reference in New Issue
Block a user