Skip to contentSkip to conversation

md-cluster: correct the num for comparison

PATCH RESEND New Goldwyn Rodrigues 1 participant 1 message Apr 21, 2015 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 md-cluster: correct the num for comparison

Author: Guoqing Jiang <[email protected]>

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.

drivers/md/md-cluster.c +3 -3
index 96679b2..8ef9e3d 100644
@@ -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;
 	}