summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-handler.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-handler.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 6dee0355d3d..6b5b01c770d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -1386,6 +1386,12 @@ glusterd_handle_add_brick (rpcsvc_request_t *req)
goto brick_val;
if (!brick_count || !volinfo->sub_count)
goto brick_val;
+
+ if (volinfo->brick_count < volinfo->sub_count) {
+ if ((volinfo->sub_count - volinfo->brick_count) == brick_count)
+ goto brick_val;
+ }
+
if ((brick_count % volinfo->sub_count) != 0) {
snprintf(err_str, 2048, "Incorrect number of bricks"
" supplied %d for type %s with count %d",