From: Chunmei Liu Date: Fri, 18 Mar 2022 04:12:26 +0000 (-0700) Subject: crimson: let read operation return result in MOSDOpReply X-Git-Tag: v18.0.0~1231^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F45517%2Fhead;p=ceph.git crimson: let read operation return result in MOSDOpReply otherwise cmp_xattr will failed, only check if return result for write operation. Signed-off-by: Chunmei Liu --- diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index 021d41b1cfef..19a153312171 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -753,11 +753,11 @@ PG::do_osd_ops( Ref{this}, obc, op_info, *m), m->ops, op_info, - [this, m, obc, rvec = op_info.allows_returnvec()] { + [this, m, obc, may_write = op_info.may_write(), rvec = op_info.allows_returnvec()] { // 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) { + if (result > 0 && may_write && !rvec) { result = 0; } auto reply = crimson::make_message(m.get(),