From 7091268cfa4c2dfc2a32e7dab6ccae310d9495f6 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Mon, 15 Aug 2016 18:00:37 +0800 Subject: [PATCH] bluestore: initialize csum_order properly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/os/bluestore/BlueStore.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index dc7e822b4d518..726d5c74055ef 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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;