]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson: let read operation return result in MOSDOpReply 45517/head
authorChunmei Liu <chunmei.liu@intel.com>
Fri, 18 Mar 2022 04:12:26 +0000 (21:12 -0700)
committerChunmei Liu <chunmei.liu@intel.com>
Sat, 19 Mar 2022 02:58:43 +0000 (19:58 -0700)
otherwise cmp_xattr will failed,
only check if return result for write operation.

Signed-off-by: Chunmei Liu <chunmei.liu@intel.com>
src/crimson/osd/pg.cc

index 021d41b1cfefe8422498c0437c9e190daef4e1cb..19a153312171418b8d1b43db45e7ea59014ee4e8 100644 (file)
@@ -753,11 +753,11 @@ PG::do_osd_ops(
       Ref<PG>{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<MOSDOpReply>(m.get(),