From: Yehuda Sadeh Date: Mon, 25 Mar 2013 16:50:33 +0000 (-0700) Subject: rgw: bucket index ops on system buckets shouldn't do anything X-Git-Tag: v0.56.4~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=90ab120a3c08f30654207c9c67fb0a4ff1476aff;p=ceph.git 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 Reviewed-by: Greg Farnum (cherry picked from commit 70e0ee8ba955322832f0c366537ddf7a0288761e) --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index b55bd63d97c..78d2e69f7d6 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -1746,7 +1746,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 { diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index f86ef8cd833..69a65bb1fb9 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -694,9 +694,15 @@ public: utime_t& ut, string& etag, string& content_type, bufferlist *acl_bl, RGWObjCategory category, list *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); }