Skip to content

Commit

Permalink
md-cluster: correct the num for comparison
Browse files Browse the repository at this point in the history
Since the node num of md-cluster is from zero, and
cinfo->slot_number represents the slot num of dlm,
no need to check for equality.

Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: NeilBrown <neilb@suse.de>
  • Loading branch information
Guoqing Jiang authored and NeilBrown committed Apr 21, 2015
1 parent 124eb76 commit 8c58f02
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/md/md-cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,9 +612,9 @@ static int join(struct mddev *mddev, int nodes)
if (ret)
goto err;
wait_for_completion(&cinfo->completion);
if (nodes <= cinfo->slot_number) {
pr_err("md-cluster: Slot allotted(%d) greater than available slots(%d)", cinfo->slot_number - 1,
nodes);
if (nodes < cinfo->slot_number) {
pr_err("md-cluster: Slot allotted(%d) is greater than available slots(%d).",
cinfo->slot_number, nodes);
ret = -ERANGE;
goto err;
}
Expand Down

0 comments on commit 8c58f02

Please sign in to comment.