]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cls_rgw: reset return code in some cases
authorYehuda Sadeh <yehuda.sadeh@dreamhost.com>
Tue, 3 Apr 2012 18:30:57 +0000 (11:30 -0700)
committerYehuda Sadeh <yehuda.sadeh@dreamhost.com>
Tue, 3 Apr 2012 18:30:57 +0000 (11:30 -0700)
Beforehand the return code was ignored, so fixed the cases
where we erroneously return error instead of success.

Signed-off-by: Yehuda Sadeh <yehuda.sadeh@dreamhost.com>
src/cls_rgw.cc

index fd2e4d797e67ad70ea33999d6ead98b50b41d888..85603fad64130fa2a7c1914d3616b16e17796d3e 100644 (file)
@@ -140,6 +140,8 @@ int rgw_bucket_prepare_op(cls_method_context_t hctx, bufferlist *in, bufferlist
   if (rc < 0 && rc != -ENOENT)
     return rc;
 
+  rc = 0;
+
   struct rgw_bucket_dir_entry entry;
   if (rc != -ENOENT) {
     bufferlist::iterator biter = cur_value.begin();
@@ -198,6 +200,7 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist
     if (rc != -ENOENT) {
       return rc;
     } else {
+      rc = 0;
       entry.name = op.name;
       entry.epoch = op.epoch;
       entry.meta = op.meta;