linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] md-cluster: correct the num for comparison
@ 2015-04-14 15:42 Goldwyn Rodrigues
  2015-04-20  1:48 ` NeilBrown
  0 siblings, 1 reply; 3+ messages in thread
From: Goldwyn Rodrigues @ 2015-04-14 15:42 UTC (permalink / raw)
  To: neilb; +Cc: GQJiang, linux-raid

Author: 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,
no need to check for equality.

Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@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 96679b2..6bdc45e 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) {
 		pr_err("md-cluster: Slot allotted(%d) greater than available slots(%d)", cinfo->slot_number - 1,
 			nodes);
 		ret = -ERANGE;
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/6] md-cluster: correct the num for comparison
  2015-04-14 15:42 [PATCH 1/6] md-cluster: correct the num for comparison Goldwyn Rodrigues
@ 2015-04-20  1:48 ` NeilBrown
  2015-04-21 16:31   ` Goldwyn Rodrigues
  0 siblings, 1 reply; 3+ messages in thread
From: NeilBrown @ 2015-04-20  1:48 UTC (permalink / raw)
  To: Goldwyn Rodrigues; +Cc: GQJiang, linux-raid

[-- Attachment #1: Type: text/plain, Size: 1330 bytes --]

On Tue, 14 Apr 2015 10:42:32 -0500 Goldwyn Rodrigues <rgoldwyn@suse.de> wrote:

> Author: 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,
> no need to check for equality.
> 
> Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@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 96679b2..6bdc45e 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) {
>  		pr_err("md-cluster: Slot allotted(%d) greater than available slots(%d)", cinfo->slot_number - 1,
>  			nodes);
>  		ret = -ERANGE;

I'll apply this, but it would be nice to fix the error message too.
If 'nodes' is 3 and 'slot_number' is 4, then the message would be
   md-cluster: Slot allotted(3) greater than available slots(3)
which looks weird.
(it should be "is greater", and there should be a "." at the end of the
sentence).

NeilBrown

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/6] md-cluster: correct the num for comparison
  2015-04-20  1:48 ` NeilBrown
@ 2015-04-21 16:31   ` Goldwyn Rodrigues
  0 siblings, 0 replies; 3+ messages in thread
From: Goldwyn Rodrigues @ 2015-04-21 16:31 UTC (permalink / raw)
  To: NeilBrown; +Cc: GQJiang, linux-raid

Hi Neil,

On 04/19/2015 08:48 PM, NeilBrown wrote:
> On Tue, 14 Apr 2015 10:42:32 -0500 Goldwyn Rodrigues <rgoldwyn@suse.de> wrote:
>
>> Author: 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,
>> no need to check for equality.
>>
>> Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
>> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@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 96679b2..6bdc45e 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) {
>>   		pr_err("md-cluster: Slot allotted(%d) greater than available slots(%d)", cinfo->slot_number - 1,
>>   			nodes);
>>   		ret = -ERANGE;
>
> I'll apply this, but it would be nice to fix the error message too.
> If 'nodes' is 3 and 'slot_number' is 4, then the message would be
>     md-cluster: Slot allotted(3) greater than available slots(3)
> which looks weird.
> (it should be "is greater", and there should be a "." at the end of the
> sentence).
>


Yes, I have corrected this and re-sent the patch.

Thanks,


-- 
Goldwyn

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-21 16:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-14 15:42 [PATCH 1/6] md-cluster: correct the num for comparison Goldwyn Rodrigues
2015-04-20  1:48 ` NeilBrown
2015-04-21 16:31   ` Goldwyn Rodrigues

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).