From: Chunmei Liu Date: Wed, 30 Mar 2022 00:26:15 +0000 (-0700) Subject: crimson: set result = 0 when op.flags include CEPH_OSD_OP_FLAG_FAILOK X-Git-Tag: v18.0.0~1139^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F45719%2Fhead;p=ceph.git crimson: set result = 0 when op.flags include CEPH_OSD_OP_FLAG_FAILOK Signed-off-by: Chunmei Liu --- diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index 1efb388b39379..dadbc8dd54a5e 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -766,7 +766,10 @@ PG::do_osd_ops( } } } else if (result > 0 && may_write && !rvec) { - result = 0; + result = 0; + } else if (result < 0 && (m->ops.empty() ? + 0 : m->ops.back().op.flags & CEPH_OSD_OP_FLAG_FAILOK)) { + result = 0; } auto reply = crimson::make_message(m.get(), result, @@ -791,6 +794,10 @@ PG::do_osd_ops( [m, this] (const std::error_code& e) { auto reply = crimson::make_message( m.get(), -e.value(), get_osdmap_epoch(), 0, false); + if (m->ops.empty() ? 0 : + m->ops.back().op.flags & CEPH_OSD_OP_FLAG_FAILOK) { + reply->set_result(0); + } reply->set_enoent_reply_versions( peering_state.get_info().last_update, peering_state.get_info().last_user_version);