]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix collect()'s return in coroutine 19606/head
authorXinying Song <songxinying@cloudin.cn>
Wed, 20 Dec 2017 00:48:10 +0000 (08:48 +0800)
committerXinying Song <songxinying@cloudin.cn>
Wed, 20 Dec 2017 06:04:10 +0000 (14:04 +0800)
Return true when the rgw_spawned_stack is not fully checked.
Signed-off-by: Xinying Song <songxinying@cloudin.cn>
src/rgw/rgw_coroutine.cc

index 479805b29b6534554f1f8ed84664eea90d32d6e8..d747d5a886881d754e6e11a1b705df8d35f0d3aa 100644 (file)
@@ -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<RGWCoroutinesStack *> 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 */