]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson:return read error code in MOSDOpReply 45550/head
authorChunmei Liu <chunmei.liu@intel.com>
Mon, 21 Mar 2022 06:14:17 +0000 (23:14 -0700)
committerChunmei Liu <chunmei.liu@intel.com>
Wed, 23 Mar 2022 04:52:29 +0000 (21:52 -0700)
Signed-off-by: Chunmei Liu <chunmei.liu@intel.com>
src/crimson/osd/pg.cc

index 19a153312171418b8d1b43db45e7ea59014ee4e8..1efb388b39379b24cc0b121d21ee5611913f3500 100644 (file)
@@ -753,12 +753,20 @@ PG::do_osd_ops(
       Ref<PG>{this}, obc, op_info, *m),
     m->ops,
     op_info,
-    [this, m, obc, may_write = op_info.may_write(), rvec = op_info.allows_returnvec()] {
+    [this, m, obc, may_write = op_info.may_write(),
+     may_read = op_info.may_read(), 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 && may_write && !rvec) {
-        result = 0;
+      if (may_read && result >= 0) {
+        for (auto &osdop : m->ops) {
+          if (osdop.rval < 0 && !(osdop.op.flags & CEPH_OSD_OP_FLAG_FAILOK)) {
+            result = osdop.rval.code;
+            break;
+          }
+        }
+      } else if (result > 0 && may_write && !rvec) {
+          result = 0;
       }
       auto reply = crimson::make_message<MOSDOpReply>(m.get(),
                                              result,