From: zhang Shaowen Date: Mon, 15 Jul 2019 07:25:45 +0000 (+0800) Subject: rgw: shard number should be non-negative when resharding the bucket X-Git-Tag: v15.1.0~1558^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7d84a4b0dbdbdb66205300b95a9e5f2d542f62cc;p=ceph-ci.git rgw: shard number should be non-negative when resharding the bucket Signed-off-by: zhang Shaowen --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 96b4241aea7..711f22fdc18 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -2598,6 +2598,11 @@ int check_reshard_bucket_params(RGWRados *store, return -EINVAL; } + if (num_shards < 0) { + cerr << "ERROR: num_shards must be non-negative integer" << std::endl; + return -EINVAL; + } + int ret = init_bucket(tenant, bucket_name, bucket_id, bucket_info, bucket, &attrs); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl;