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>
(cherry picked from commit
b3aa29e324cf0a96a1f2f5dcf1ba998219457bcd)
Conflicts:
src/osd/ReplicatedPG.cc: trivial resolution
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;
- }
-
op.extent.length = total_read;
::encode(m, osd_op.outdata);