Merge pull request #59884 from cbodley/wip-51786

cls/user: reset stats only returns marker when truncated

Reviewed-by: Daniel Gryniewicz <dang@redhat.com>
This commit is contained in:
Casey Bodley 2024-10-07 09:10:41 -04:00 committed by GitHub
commit 49a7596913
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -482,10 +482,6 @@ static int cls_user_reset_stats2(cls_method_context_t hctx,
add_header_stats(&ret.acc_stats, e);
}
/* try-update marker */
if(!keys.empty())
ret.marker = (--keys.cend())->first;
if (! ret.truncated) {
buffer::list bl;
header.last_stats_update = op.time;
@ -500,6 +496,10 @@ static int cls_user_reset_stats2(cls_method_context_t hctx,
return rc;
}
/* try-update marker */
if(!keys.empty())
ret.marker = (--keys.cend())->first;
/* return partial result */
encode(ret, *out);
return 0;