From: Kefu Chai Date: Thu, 20 Aug 2020 17:29:51 +0000 (+0800) Subject: crimson/osd: return rval which is negative X-Git-Tag: v17.0.0~1379^2~8 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c850a1d25d357daf36eeeb3af8c9abbada336739;p=ceph.git crimson/osd: return rval which is negative a less-than-zero rval indicates an error, and should not be normalized to 0 if allows_returnvec() evaluates to false. probably we need a better way to return a negative error code which does not fall into any known error. but at this moment, grab the last rval and return it if it is less than zero, can be used as a short term solution. Signed-off-by: Kefu Chai --- diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index 99b79394b59e9..7821c7b0855df 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -629,7 +629,12 @@ seastar::future> PG::do_osd_ops( obc, ox_deleter = std::move(ox), rvec = op_info.allows_returnvec()] { - auto result = m->ops.empty() || !rvec ? 0 : m->ops.back().rval.code; + // TODO: should stop at the first op which returns a negative retval, + // cmpext uses it for returning the index of first unmatched byte + int result = m->ops.empty() ? 0 : m->ops.back().rval.code; + if (result > 0 && !rvec) { + result = 0; + } auto reply = make_message(m.get(), result, get_osdmap_epoch(),