From 31b6340b8707934be8d6a6c87a4abd9b529af0bc Mon Sep 17 00:00:00 2001 From: Chunmei Liu Date: Tue, 29 Mar 2022 17:26:15 -0700 Subject: [PATCH] crimson: set result = 0 when op.flags include CEPH_OSD_OP_FLAG_FAILOK Signed-off-by: Chunmei Liu --- src/crimson/osd/pg.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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); -- 2.47.3