]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
bluestore: initialize csum_order properly 10728/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 15 Aug 2016 10:00:37 +0000 (18:00 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Mon, 15 Aug 2016 10:00:37 +0000 (18:00 +0800)
To kill the following warning:

In file included from /home/jenkins-build/build/workspace/ceph-pull-requests/src/os/bluestore/BlueStore.h:39:0,
                 from /home/jenkins-build/build/workspace/ceph-pull-requests/src/os/bluestore/BlueStore.cc:22:
/home/jenkins-build/build/workspace/ceph-pull-requests/src/os/bluestore/bluestore_types.h: In member function ‘int BlueStore::_do_alloc_write(BlueStore::TransContext*, BlueStore::WriteContext*)’:
/home/jenkins-build/build/workspace/ceph-pull-requests/src/os/bluestore/bluestore_types.h:558:29: warning: ‘csum_order’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     csum_chunk_order = order;
                             ^
/home/jenkins-build/build/workspace/ceph-pull-requests/src/os/bluestore/BlueStore.cc:6145:14: note: ‘csum_order’ was declared here
     unsigned csum_order;

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

index dc7e822b4d518f05768a0dd56a6b4d805e3577e3..726d5c74055efec372ae7739ed134d1edb80bbdb 100644 (file)
@@ -6142,7 +6142,7 @@ int BlueStore::_do_alloc_write(
     bufferlist *l = &wi.bl;
     uint64_t final_length = wi.blob_length;
     uint64_t csum_length = wi.blob_length;
-    unsigned csum_order;
+    unsigned csum_order = block_size_order;
     bufferlist compressed_bl;
     CompressorRef c;
     bool compressed = false;