Use another variable to store the value of osd_deep_scrub_stride for later use
because osd_deep_scrub_stride can be modified on the fly, otherwise we may get
an incorrect digest value that contains only part of the object data
when osd_deep_scrub_stride is modified and it will make pg inconsistent.
Fixes: https://tracker.ceph.com/issues/58240
Signed-off-by: Zhansong Gao <zhsgao@hotmail.com>
pos.data_hash = bufferhash(-1);
}
+ const uint64_t stride = cct->_conf->osd_deep_scrub_stride;
+
bufferlist bl;
r = store->read(
ch,
ghobject_t(
poid, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard),
pos.data_pos,
- cct->_conf->osd_deep_scrub_stride, bl,
+ stride, bl,
fadvise_flags);
if (r < 0) {
dout(20) << __func__ << " " << poid << " got "
pos.data_hash << bl;
}
pos.data_pos += r;
- if (static_cast<uint64_t>(r) == cct->_conf->osd_deep_scrub_stride) {
+ if (static_cast<uint64_t>(r) == stride) {
dout(20) << __func__ << " " << poid << " more data, digest so far 0x"
<< std::hex << pos.data_hash.digest() << std::dec << dendl;
return -EINPROGRESS;