From: Haomai Wang Date: Tue, 20 May 2014 06:32:18 +0000 (+0800) Subject: Fix set_alloc_hint op cause KeyValueStore crash problem X-Git-Tag: v0.82~28^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c08adbc98ff5f380ecd215f8bd9cf3cab214913c;p=ceph.git 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 --- diff --git a/src/os/KeyValueStore.cc b/src/os/KeyValueStore.cc index 4bd9b5fe4dde..d1642edf0ade 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 9e75b76e6223..77fc7f5f63ea 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: