]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix sanity check of object key length
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 19 Sep 2016 01:31:29 +0000 (09:31 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Mon, 19 Sep 2016 01:31:29 +0000 (09:31 +0800)
We now encode shard-id into exactly one byte.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc

index ce8ab1c9f555c8836e46b69df4ba3841d0cadd96..3045e201126693a9faf4744f2c46634bb5f1a448 100644 (file)
@@ -317,7 +317,7 @@ static int get_key_object(const string& key, ghobject_t *oid)
   int r;
   const char *p = key.c_str();
 
-  if (key.length() < 2 + 8 + 4)
+  if (key.length() < 1 + 8 + 4)
     return -1;
   p = _key_decode_shard(p, &oid->shard_id);