]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix raw blob encoded size
authorxie xingguo <xie.xingguo@zte.com.cn>
Sun, 9 Oct 2016 12:04:33 +0000 (20:04 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Sun, 9 Oct 2016 12:04:33 +0000 (20:04 +0800)
The maximum length of fixed fields of bluestore_blob_t shall be:

uint64_t sbid                       ///< 8 bytes
uint32_t compressed_length_orig     ///< 4 bytes
uint32_t compressed_length          ///< 4 bytes
uint32_t flags                      ///< 4 bytes
uint8_t csum_type                   ///< 1 byte
uint8_t csum_chunk_order            ///< 1 byte
unused_t unused;                    ///< 2 bytes

8 + 4 + 4 + 4 + 1 + 1 + 2 = 24

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

index 5d8642d898c9e178ac0d1529dbb28f916ab3c400..7be9f069452db0add4d7e18e824fd0fdd4beabe2 100644 (file)
@@ -296,7 +296,7 @@ struct bluestore_blob_t {
 
   int estimate_encoded_size() const {
     // conservative upper bound... fixme
-    return csum_data.length() + extents.size() * 16 + 48;
+    return csum_data.length() + extents.size() * 16 + 24;
   }
 
   bool can_split() const {