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: attach csum for compressed blobs #37168

Merged
merged 1 commit into from Oct 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/os/bluestore/BlueStore.cc
Expand Up @@ -13639,12 +13639,23 @@ int BlueStore::_do_alloc_write(
if (wi.compressed) {
final_length = wi.compressed_bl.length();
csum_length = final_length;
unsigned csum_order = ctz(csum_length);
l = &wi.compressed_bl;
dblob.set_compressed(wi.blob_length, wi.compressed_len);
if (csum != Checksummer::CSUM_NONE) {
dout(20) << __func__ << " initialize csum setting for compressed blob " << *b
<< " csum_type " << Checksummer::get_csum_type_string(csum)
<< " csum_order " << csum_order
<< " csum_length 0x" << std::hex << csum_length
<< " blob_length 0x" << wi.blob_length
<< " compressed_length 0x" << wi.compressed_len << std::dec
<< dendl;
dblob.init_csum(csum, csum_order, csum_length);
}
} else if (wi.new_blob) {
unsigned csum_order;
// initialize newly created blob only
ceph_assert(dblob.is_mutable());
unsigned csum_order;
if (l->length() != wi.blob_length) {
// hrm, maybe we could do better here, but let's not bother.
dout(20) << __func__ << " forcing csum_order to block_size_order "
Expand Down