From 70e0ee8ba955322832f0c366537ddf7a0288761e Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Mon, 25 Mar 2013 09:50:33 -0700 Subject: [PATCH] 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 --- src/rgw/rgw_rados.cc | 2 +- src/rgw/rgw_rados.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 85a631902fa30..0c32d39cba91b 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -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 { diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index ed6f35eca72c6..31d50fb9d456c 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -718,9 +718,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); } -- 2.39.5