From: Song Shun Date: Wed, 19 Dec 2018 02:55:43 +0000 (+0800) Subject: Objecter.cc: make op resend logic more readable X-Git-Tag: v14.1.0~581^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F25622%2Fhead;p=ceph.git Objecter.cc: make op resend logic more readable make op resend logic more readable according to discussion at https://github.com/ceph/ceph/pull/25243 Signed-off-by: Song Shun --- diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index c7b043b5e58b..b5b8a2053315 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -2876,13 +2876,12 @@ int Objecter::_calc_target(op_target_t *t, Connection *con, bool any_change) force_resend = true; } - bool unpaused = !target_should_be_paused(t); - if (t->paused && unpaused) { - t->paused = false; - } else { - t->paused = !unpaused; - unpaused = false; + bool unpaused = false; + bool should_be_paused = target_should_be_paused(t); + if (t->paused && !should_be_paused) { + unpaused = true; } + t->paused = should_be_paused; bool legacy_change = t->pgid != pgid ||