From: Yehuda Sadeh Date: Wed, 24 May 2017 23:53:34 +0000 (-0700) Subject: cls/rgw: reshard add command doesn't read existing status X-Git-Tag: ses5-milestone6~8^2~7^2~28 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=436f151e55008427a5967898cc707831fbd580f2;p=ceph.git cls/rgw: reshard add command doesn't read existing status No need to read existing status. Signed-off-by: Yehuda Sadeh --- diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index 8964081ceed91..3034b146c974b 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -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;