From: Robin H. Johnson Date: Mon, 12 Mar 2018 21:42:00 +0000 (-0700) Subject: cls/rgw: usage_iterate_range end conditions X-Git-Tag: v12.2.5~18^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=878d50c34a7d0104c1102cb3398be9e47b854bf7;p=ceph.git cls/rgw: usage_iterate_range end conditions If both end & start conditions are passed, we need to signal that there are no more results when returning because the end condition is satisifed. Suggested-by: Yehuda Sadeh Signed-off-by: Robin H. Johnson (cherry picked from commit 163c49fd1da8e819a0ff8c7c7aaa550b01b8012a) --- diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index 12258319796d..64f85e6fa0b5 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -2982,8 +2982,10 @@ static int usage_iterate_range(cls_method_context_t hctx, uint64_t start, uint64 continue; /* keys are sorted by epoch, so once we're past end we're done */ - if (e.epoch >= end) + if (e.epoch >= end) { + *truncated = false; return 0; + } ret = cb(hctx, key, e, param); if (ret < 0)