Move ahead the result code checking logic before we continue to verify the trailing hole, otherwise
the real result of non-hole reading may be overwritten and thus confuse caller.
Fixes: #14151
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
data_bl.claim_append(tmpbl);
last = miter->first + r;
}
+
+ if (r < 0) {
+ result = r;
+ break;
+ }
// verify trailing hole?
if (cct->_conf->osd_verify_sparse_read_holes) {
}
}
- if (r < 0) {
- result = r;
- break;
- }
-
// Why SPARSE_READ need checksum? In fact, librbd always use sparse-read.
// Maybe at first, there is no much whole objects. With continued use, more and more whole object exist.
// So from this point, for spare-read add checksum make sense.