]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Fix set_alloc_hint op cause KeyValueStore crash problem 1840/head
authorHaomai Wang <haomaiwang@gmail.com>
Tue, 20 May 2014 06:32:18 +0000 (14:32 +0800)
committerHaomai Wang <haomaiwang@gmail.com>
Wed, 21 May 2014 04:51:13 +0000 (12:51 +0800)
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 <xinxin.shu5040@gmail.com>
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
src/os/KeyValueStore.cc
src/os/MemStore.cc

index 4bd9b5fe4dde1830eab8b8329fe8e2d1f5e12ddc..d1642edf0ade9593da2cc312769b130768675ae3 100644 (file)
@@ -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:
index 9e75b76e622324aaa8b4bd5cb1aa612903cd3aa0..77fc7f5f63ea1f7d4413ba46a1a8df674ef9a052 100644 (file)
@@ -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: