]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: bucket index ops on system buckets shouldn't do anything
authorYehuda Sadeh <yehuda@inktank.com>
Mon, 25 Mar 2013 16:50:33 +0000 (09:50 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Mon, 25 Mar 2013 17:20:01 +0000 (10:20 -0700)
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>
Reviewed-by: Greg Farnum <greg@inktank.com>
(cherry picked from commit 70e0ee8ba955322832f0c366537ddf7a0288761e)

src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index b55bd63d97c74312caa205e2fac2c0b781610899..78d2e69f7d6d0c336a6f5c8d6bfad414b4721afa 100644 (file)
@@ -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 {
index f86ef8cd8330c4bc9260a8fdddeb89e1fca8c673..69a65bb1fb933d3b50fe113dcd39ea664de4f7eb 100644 (file)
@@ -694,9 +694,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);
   }