From c08adbc98ff5f380ecd215f8bd9cf3cab214913c Mon Sep 17 00:00:00 2001 From: Haomai Wang Date: Tue, 20 May 2014 14:32:18 +0800 Subject: [PATCH] Fix set_alloc_hint op cause KeyValueStore crash problem Now KeyValueStore doesn't support set_alloc_hit op, the implementation of _do_transaction need to consider decoding the arguments. Otherwise, the arguments will be regarded as the next op. Fix the same problem for MemStore. Fix #8381 Reported-by: Xinxin Shu Signed-off-by: Haomai Wang --- src/os/KeyValueStore.cc | 8 +++++++- src/os/MemStore.cc | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/os/KeyValueStore.cc b/src/os/KeyValueStore.cc index 4bd9b5fe4dde1..d1642edf0ade9 100644 --- a/src/os/KeyValueStore.cc +++ b/src/os/KeyValueStore.cc @@ -1448,7 +1448,13 @@ unsigned KeyValueStore::_do_transaction(Transaction& transaction, break; case Transaction::OP_SETALLOCHINT: - // TODO: can kvstore make use of the hint? + { + // TODO: can kvstore make use of the hint? + coll_t cid(i.get_cid()); + ghobject_t oid = i.get_oid(); + uint64_t expected_object_size = i.get_length(); + uint64_t expected_write_size = i.get_length(); + } break; default: diff --git a/src/os/MemStore.cc b/src/os/MemStore.cc index 9e75b76e62232..77fc7f5f63ea1 100644 --- a/src/os/MemStore.cc +++ b/src/os/MemStore.cc @@ -950,7 +950,12 @@ void MemStore::_do_transaction(Transaction& t) break; case Transaction::OP_SETALLOCHINT: - // nop + { + coll_t cid(i.get_cid()); + ghobject_t oid = i.get_oid(); + uint64_t expected_object_size = i.get_length(); + uint64_t expected_write_size = i.get_length(); + } break; default: -- 2.39.5