linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: gqjiang@suse.com
To: neilb@suse.de
Cc: linux-raid@vger.kernel.org, rgoldwyn@suse.de,
	Guoqing Jiang <gqjiang@suse.com>
Subject: [PATCH] md-cluster: correct the num for comparison
Date: Fri, 10 Apr 2015 16:06:12 +0800	[thread overview]
Message-ID: <1428653172-12678-1-git-send-email-gqjiang@suse.com> (raw)

From: Guoqing Jiang <gqjiang@suse.com>

Since the node num of md-cluster is from zero, and
cinfo->slot_number represents the slot num of dlm,
here also need to deduct one to keep consistency
with other codes.

Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
---
 drivers/md/md-cluster.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c
index ae8bb54..531cc2b 100644
--- a/drivers/md/md-cluster.c
+++ b/drivers/md/md-cluster.c
@@ -612,7 +612,7 @@ static int join(struct mddev *mddev, int nodes)
 	if (ret)
 		goto err;
 	wait_for_completion(&cinfo->completion);
-	if (nodes <= cinfo->slot_number) {
+	if (nodes <= cinfo->slot_number - 1) {
 		pr_err("md-cluster: Slot allotted(%d) greater than available slots(%d)", cinfo->slot_number - 1,
 			nodes);
 		ret = -ERANGE;
-- 
1.7.12.4


             reply	other threads:[~2015-04-10  8:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-10  8:06 gqjiang [this message]
2015-04-10 13:35 ` [PATCH] md-cluster: correct the num for comparison Goldwyn Rodrigues

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1428653172-12678-1-git-send-email-gqjiang@suse.com \
    --to=gqjiang@suse.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=rgoldwyn@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).