]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cls/rgw: usage_iterate_range end conditions
authorRobin H. Johnson <robin.johnson@dreamhost.com>
Mon, 12 Mar 2018 21:42:00 +0000 (14:42 -0700)
committerAbhishek Lekshmanan <abhishek@suse.com>
Thu, 12 Apr 2018 17:27:35 +0000 (19:27 +0200)
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 <yehuda@redhat.com>
Signed-off-by: Robin H. Johnson <robin.johnson@dreamhost.com>
(cherry picked from commit 163c49fd1da8e819a0ff8c7c7aaa550b01b8012a)

src/cls/rgw/cls_rgw.cc

index 12258319796d683613e20f93d499808d31d55d83..64f85e6fa0b50d8ebac5c8b6573ea1628e1fe124 100644 (file)
@@ -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)