]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Fix set_alloc_hint op cause KeyValueStore crash problem
authorHaomai Wang <haomaiwang@gmail.com>
Tue, 20 May 2014 06:32:18 +0000 (14:32 +0800)
committerSage Weil <sage@redhat.com>
Thu, 21 Aug 2014 03:50:05 +0000 (20:50 -0700)
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>
(cherry picked from commit c08adbc98ff5f380ecd215f8bd9cf3cab214913c)

src/os/KeyValueStore.cc
src/os/MemStore.cc

index c8bc7c56d8c4b16733e94110abc96a60630bde7f..d9cdd05c0646dff5c519993b635f82b1a208f015 100644 (file)
@@ -1451,7 +1451,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: