]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: object removal should remove object from index anyway
authorYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 21 Oct 2011 17:32:54 +0000 (10:32 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 21 Oct 2011 17:32:54 +0000 (10:32 -0700)
even if object doesn't exist. Index might have the wrong info.

src/rgw/rgw_rados.cc

index e2ad4d5cde295533743cd007ee5eede3f14e1f15..3a894cd00c6a8b0bfd69654f63ffe869d6cd3f30 100644 (file)
@@ -1019,8 +1019,7 @@ int RGWRados::delete_obj_impl(void *ctx, std::string& id, rgw_obj& obj, bool syn
   if (r < 0)
     return r;
 
-  if (state && !state->exists)
-    return -ENOENT;
+  bool ret_not_existed = (state && !state->exists);
 
   string tag;
   op.remove();
@@ -1045,6 +1044,9 @@ int RGWRados::delete_obj_impl(void *ctx, std::string& id, rgw_obj& obj, bool syn
   if (r < 0)
     return r;
 
+  if (ret_not_existed)
+    return -ENOENT;
+
   return 0;
 }