]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cls/rgw: reshard add command doesn't read existing status
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 24 May 2017 23:53:34 +0000 (16:53 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 5 Jun 2017 20:17:54 +0000 (13:17 -0700)
No need to read existing status.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/cls/rgw/cls_rgw.cc

index 8964081ceed911f63019b976a5ea46b991d15d67..3034b146c974be367d1c4d0cf22aae1eb7eb22e2 100644 (file)
@@ -3510,18 +3510,10 @@ static int rgw_reshard_add(cls_method_context_t hctx, bufferlist *in, bufferlist
 
   string key;
   generate_reshard_key(op.entry, &key);
-  bufferlist bl;
-  int ret = cls_cxx_map_get_val(hctx, key, &bl);
-  if (ret < 0 && ret != -ENOENT) {
-    CLS_ERR("error adding reshard job for bucket %s with key %s: %d",op.entry.bucket_name.c_str(), key.c_str()
-           , ret);
-    return ret;
-  } else if (ret != -ENOENT) {
-    return -EEXIST;
-  }
 
+  bufferlist bl;
   ::encode(op.entry, bl);
-  ret = cls_cxx_map_set_val(hctx, key, &bl);
+  int ret = cls_cxx_map_set_val(hctx, key, &bl);
   if (ret < 0) {
     CLS_ERR("error adding reshard job for bucket %s with key %s",op.entry.bucket_name.c_str(), key.c_str());
     return ret;