From 3b5e8386910f22e51eb6588ce5300077c6880382 Mon Sep 17 00:00:00 2001 From: Chunmei Liu Date: Thu, 17 Mar 2022 21:12:26 -0700 Subject: [PATCH] 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 --- src/crimson/osd/pg.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index 021d41b1cfe..19a15331217 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(), -- 2.39.5