Merge pull request #7016 from xiexingguo/xxg-wip-14151

osd: fix sparse-read result code checking logic

Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Sage Weil 2016-01-03 13:20:01 -05:00
commit 2533f876b1

View File

@ -4182,6 +4182,11 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
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) {
@ -4197,11 +4202,6 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
}
}
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.