Skip to content

Commit

Permalink
Merge pull request #5719 from dachary/wip-12855-hammer
Browse files Browse the repository at this point in the history
segmentation fault when rgw_gc_max_objs > HASH_PRIME
  • Loading branch information
yehudasa committed Sep 24, 2015
2 parents 19e549e + 6acf36f commit e26f8bc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/rgw/rgw_gc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ int RGWGC::list(int *index, string& marker, uint32_t max, bool expired_only, std
{
result.clear();

for (; *index < cct->_conf->rgw_gc_max_objs && result.size() < max; (*index)++, marker.clear()) {
for (; *index < max_objs && result.size() < max; (*index)++, marker.clear()) {
std::list<cls_rgw_gc_obj_info> entries;
int ret = cls_rgw_gc_list(store->gc_pool_ctx, obj_names[*index], marker, max - result.size(), expired_only, entries, truncated);
if (ret == -ENOENT)
Expand All @@ -108,7 +108,7 @@ int RGWGC::list(int *index, string& marker, uint32_t max, bool expired_only, std
result.push_back(*iter);
}

if (*index == cct->_conf->rgw_gc_max_objs - 1) {
if (*index == max_objs - 1) {
/* we cut short here, truncated will hold the correct value */
return 0;
}
Expand Down Expand Up @@ -234,7 +234,6 @@ int RGWGC::process(int index, int max_secs)

int RGWGC::process()
{
int max_objs = cct->_conf->rgw_gc_max_objs;
int max_secs = cct->_conf->rgw_gc_processor_max_time;

unsigned start;
Expand Down

0 comments on commit e26f8bc

Please sign in to comment.