From: Huber-ming Date: Wed, 13 Jul 2022 05:47:43 +0000 (+0800) Subject: cls_rgw: nonexists object shoud not be accounted when check_index X-Git-Tag: v18.0.0~440^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=89ee1d1199ff1dec38114915eaf068e5b80ffd2a;p=ceph-ci.git cls_rgw: nonexists object shoud not be accounted when check_index Signed-off-by: Huber-ming --- diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index e440b73ecec..25fe3b27576 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -718,12 +718,14 @@ static int check_index(cls_method_context_t hctx, CLS_LOG(1, "ERROR: rgw_bucket_list(): failed to decode entry, key=%s", kiter->first.c_str()); return -EIO; } - rgw_bucket_category_stats& stats = calc_header->stats[entry.meta.category]; - stats.num_entries++; - stats.total_size += entry.meta.accounted_size; - stats.total_size_rounded += cls_rgw_get_rounded_size(entry.meta.accounted_size); - stats.actual_size += entry.meta.size; - + if (entry.exists) { + rgw_bucket_category_stats& stats = calc_header->stats[entry.meta.category]; + stats.num_entries++; + stats.total_size += entry.meta.accounted_size; + stats.total_size_rounded += cls_rgw_get_rounded_size(entry.meta.accounted_size); + stats.actual_size += entry.meta.size; + } + start_obj = kiter->first; } } while (keys.size() == CHECK_CHUNK_SIZE && !done);