rgw: bucket index ops on system buckets shouldn't do anything

Fixes: #4508
Backport: bobtail
On certain bucket index operations we didn't check whether
the bucket was a system bucket, which caused the operations
to fail. This triggered an error message on bucket removal
operations.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
This commit is contained in:
Yehuda Sadeh 2013-03-25 09:50:33 -07:00
parent ece4348807
commit 70e0ee8ba9
2 changed files with 7 additions and 1 deletions

View File

@ -1744,7 +1744,7 @@ int RGWRados::delete_obj_impl(void *ctx, rgw_obj& obj)
r = io_ctx.operate(oid, &op);
bool removed = (r >= 0);
if ((r >= 0 || r == -ENOENT) && bucket.marker.size()) {
if (r >= 0 || r == -ENOENT) {
uint64_t epoch = io_ctx.get_last_version();
r = complete_update_index_del(bucket, obj.object, tag, epoch);
} else {

View File

@ -718,9 +718,15 @@ public:
utime_t& ut, string& etag, string& content_type, bufferlist *acl_bl, RGWObjCategory category,
list<string> *remove_objs);
int complete_update_index_del(rgw_bucket& bucket, string& oid, string& tag, uint64_t epoch) {
if (bucket_is_system(bucket))
return 0;
return cls_obj_complete_del(bucket, tag, epoch, oid);
}
int complete_update_index_cancel(rgw_bucket& bucket, string& oid, string& tag) {
if (bucket_is_system(bucket))
return 0;
return cls_obj_complete_cancel(bucket, tag, oid);
}