]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: shard number should be non-negative when resharding the bucket
authorzhang Shaowen <zhangshaowen@cmss.chinamobile.com>
Mon, 15 Jul 2019 07:25:45 +0000 (15:25 +0800)
committerzhang Shaowen <zhangshaowen@cmss.chinamobile.com>
Mon, 15 Jul 2019 07:25:45 +0000 (15:25 +0800)
Signed-off-by: zhang Shaowen <zhangshaowen@cmss.chinamobile.com>
src/rgw/rgw_admin.cc

index 96b4241aea7781786ea4f57b7bc017d9e723da13..711f22fdc18cc71791e4ce05cd8f791e57b27ec3 100644 (file)
@@ -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;