From: dwj192 Date: Wed, 9 Sep 2015 02:12:57 +0000 (+0800) Subject: objects can not be displayed which object name does not contain '.' when get the... X-Git-Tag: v10.0.0~22^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=19a191e5ccbcd10bd0227fb0fc9e3ba60c62e7b8;p=ceph.git objects can not be displayed which object name does not contain '.' when get the bucket index. Fixes: #12963 Signed-off-by: Weijun Duan --- diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index cfa5e204a44d8..b857a5fd08ff7 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -715,16 +715,19 @@ int RGWBucket::check_bad_index_multipart(RGWBucketAdminOpState& op_state, string oid = key.name; int pos = oid.find_last_of('.'); - if (pos < 0) - continue; - - string name = oid.substr(0, pos); - string suffix = oid.substr(pos + 1); - - if (suffix.compare("meta") == 0) { - meta_objs[name] = true; + if (pos < 0) { + /* obj has no suffix */ + all_objs[key] = oid; } else { - all_objs[key] = name; + /* obj has suffix */ + string name = oid.substr(0, pos); + string suffix = oid.substr(pos + 1); + + if (suffix.compare("meta") == 0) { + meta_objs[name] = true; + } else { + all_objs[key] = name; + } } }