md-cluster: correct the num for comparison
authorGuoqing Jiang <gqjiang@suse.com>
Tue, 21 Apr 2015 16:25:52 +0000 (11:25 -0500)
committerNeilBrown <neilb@suse.de>
Tue, 21 Apr 2015 21:58:31 +0000 (07:58 +1000)
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>
drivers/md/md-cluster.c

index ae8bb547f94d9153303cccecc1002ab80d29bea7..10c44a3a9d6acd4c727c379ede622793f17ee41e 100644 (file)
@@ -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;
        }