Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os/bluestore: don't re-initialize csum-setting for existing blobs #17398

Merged
merged 2 commits into from Sep 1, 2017

Conversation

xiexingguo
Copy link
Member

The global checksum setting may change, e.g., from NONE to CRC32,
which can cause improper re-initialization of the csum-settings of
existing blobs(e.g., partial write/overwrite may turn out to shrink
'csum_data').

We could develop some complicated solutions but for now let's not
bother since the above scenario is rare.

Fixes: http://tracker.ceph.com/issues/21175
Signed-off-by: xie xingguo xie.xingguo@zte.com.cn

@xiexingguo
Copy link
Member Author

retest this please

@xiexingguo
Copy link
Member Author

changeset:

  • wrong indent
diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc
index f62ef4c..f3cbca7 100644
--- a/src/os/bluestore/BlueStore.cc
+++ b/src/os/bluestore/BlueStore.cc
@@ -9931,10 +9931,10 @@ int BlueStore::_do_alloc_write(
       }
       if (csum != Checksummer::CSUM_NONE) {
         dout(20) << __func__ << " initialize csum setting for new blob " << *b
-             << " csum_type " << Checksummer::get_csum_type_string(csum)
-             << " csum_order " << csum_order
-             << " csum_length 0x" << std::hex << csum_length << std::dec
-             << dendl;
+                 << " csum_type " << Checksummer::get_csum_type_string(csum)
+                 << " csum_order " << csum_order
+                 << " csum_length 0x" << std::hex << csum_length << std::dec
+                 << dendl;
         dblob.init_csum(csum, csum_order, csum_length);
       }
     }

The global checksum setting may change, e.g., from NONE to CRC32,
which can cause improper re-initialization of the csum-settings of
existing blobs(e.g., partial write/overwrite may turn out to shrink
'csum_data').

We could develop some complicated solutions but for now let's not
bother since the above scenario is rare.

Fixes: http://tracker.ceph.com/issues/21175
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
So we don't output anything if csum is currently off:

_do_alloc_write blob Blob(0x7fad7cc25950 blob([0x42a80000~10000] none/0x1)

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
@liewegas liewegas merged commit 91bf1ed into ceph:master Sep 1, 2017
@xiexingguo xiexingguo deleted the wip-21175 branch September 3, 2017 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants