From e54d9dc5b473a624679d302c6e7b00612974aba3 Mon Sep 17 00:00:00 2001 From: Changcheng Liu Date: Thu, 30 Apr 2020 11:18:36 +0800 Subject: [PATCH] msg: correct read result check The "r >= 0" is checked under "r <= 0", so the right condition is "r == 0". Signed-off-by: Changcheng Liu --- src/msg/async/ProtocolV2.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msg/async/ProtocolV2.cc b/src/msg/async/ProtocolV2.cc index 603a9a526e5..c23b71e9052 100644 --- a/src/msg/async/ProtocolV2.cc +++ b/src/msg/async/ProtocolV2.cc @@ -756,7 +756,7 @@ CtPtr ProtocolV2::read(CONTINUATION_RXBPTR_TYPE &next, }); if (r <= 0) { // error or done synchronously - if (unlikely(pre_auth.enabled) && r >= 0) { + if (unlikely(pre_auth.enabled) && r == 0) { pre_auth.rxbuf.append(*next.node); ceph_assert(!cct->_conf->ms_die_on_bug || pre_auth.rxbuf.length() < 1000000); -- 2.39.5