From: Xinying Song Date: Wed, 20 Dec 2017 00:48:10 +0000 (+0800) Subject: rgw: fix collect()'s return in coroutine X-Git-Tag: v13.0.2~262^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dc54d3936c1514033c8e6c69bcd96e8f877e2edc;p=ceph.git rgw: fix collect()'s return in coroutine Return true when the rgw_spawned_stack is not fully checked. Signed-off-by: Xinying Song --- diff --git a/src/rgw/rgw_coroutine.cc b/src/rgw/rgw_coroutine.cc index 479805b29b65..d747d5a88688 100644 --- a/src/rgw/rgw_coroutine.cc +++ b/src/rgw/rgw_coroutine.cc @@ -302,7 +302,7 @@ int RGWCoroutinesStack::unwind(int retcode) bool RGWCoroutinesStack::collect(RGWCoroutine *op, int *ret, RGWCoroutinesStack *skip_stack) /* returns true if needs to be called again */ { - bool done = true; + bool need_retry = false; rgw_spawned_stacks *s = (op ? &op->spawned : &spawned); *ret = 0; vector new_list; @@ -324,7 +324,7 @@ bool RGWCoroutinesStack::collect(RGWCoroutine *op, int *ret, RGWCoroutinesStack *ret = r; ldout(cct, 20) << "collect(): s=" << (void *)this << " stack=" << (void *)stack << " encountered error (r=" << r << "), skipping next stacks" << dendl; new_list.insert(new_list.end(), ++iter, s->entries.end()); - done &= (iter != s->entries.end()); + need_retry = (iter != s->entries.end()); break; } @@ -332,7 +332,7 @@ bool RGWCoroutinesStack::collect(RGWCoroutine *op, int *ret, RGWCoroutinesStack } s->entries.swap(new_list); - return (!done); + return need_retry; } bool RGWCoroutinesStack::collect_next(RGWCoroutine *op, int *ret, RGWCoroutinesStack **collected_stack) /* returns true if found a stack to collect */