From a49c064b7a1b4083818b6f950d7e0aade71c6afe Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Thu, 24 Oct 2013 08:18:19 -0700 Subject: [PATCH] cls_log: always return final marker from log_list There's no reason to restrict returning the marker to the case where less than the whole log is returned, since there's already a truncated flag to tell the client what happened. Giving the client the last marker makes it easy to consume when the log entries do not contain their own marker. If the last marker is not returned, the client cannot get the last marker without racing with updates to the log. Backport: dumpling Signed-off-by: Josh Durgin (cherry picked from commit e74776f4176470122485a79a4c07e9c12c9fc036) --- src/cls/log/cls_log.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cls/log/cls_log.cc b/src/cls/log/cls_log.cc index 46ba357480c5..7b254fdbea54 100644 --- a/src/cls/log/cls_log.cc +++ b/src/cls/log/cls_log.cc @@ -211,9 +211,8 @@ static int cls_log_list(cls_method_context_t hctx, bufferlist *in, bufferlist *o if (iter == keys.end()) done = true; - else - ret.marker = marker; + ret.marker = marker; ret.truncated = !done; ::encode(ret, *out); -- 2.47.3