linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhilong Liu <zlliu@suse.com>
To: Jes Sorensen <jes.sorensen@gmail.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH v2] mdadm/grow: adding a test to ensure resize was required
Date: Wed, 18 Oct 2017 16:01:43 +0800	[thread overview]
Message-ID: <c3ec4c9d-f7ff-db9a-325c-ff107bdd6690@suse.com> (raw)
In-Reply-To: <1c66e9b1-59fd-cfe6-bc03-df735421b7a5@gmail.com>



On 10/12/2017 01:31 AM, Jes Sorensen wrote:
> On 10/11/2017 04:53 AM, Zhilong Liu wrote:
>> To fix the commit: 4b74a905a67e
>> (mdadm/grow: Component size must be larger than chunk size)
>>
>> array.level > 1 : against the raids which chunk_size is meaningful.
>> s->size > 0 : ensure that changing component size has required.
>> array.chunk_size / 1024 > s->size : ensure component size should
>> be always >= current chunk_size when requires resize, otherwise,
>> mddev->pers->resize would be set mddev->dev_sectors as '0'.
>>
>> Reported-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
>> Suggested-by: NeilBrown <neilb@suse.com>
>> Signed-off-by: Zhilong Liu <zlliu@suse.com>
>> ---
>>
>> v1: [PATCH 1/3] mdadm/Grow: fix the broken raid level conversion
>>
>> changes:
>>    correct the test 's->level == UnSet' as 's->size > 0'
>>
>>   Grow.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/Grow.c b/Grow.c
>> index 4d79d83..8c2d50c 100644
>> --- a/Grow.c
>> +++ b/Grow.c
>> @@ -1810,6 +1810,7 @@ int Grow_reshape(char *devname, int fd,
>>       }
>>         if (array.level > 1 &&
>> +        s->size > 0 &&
>>          (array.chunk_size / 1024) > (int)s->size) {
>>           pr_err("component size must be larger than chunk size.\n");
>>           return 1;
>
> Applied, however I fixed the broken formatting in the process.
>

I'm sorry that I have re-checked the code, this patch is buggy.
The correct fix should be "s->size > 1" or "s->level == UnSet",
I forgot the parameter of "--size max".

Thanks,
-Zhilong

> Thanks,
> Jes
>
>
> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


  parent reply	other threads:[~2017-10-18  8:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09  8:21 [mdadm PATCH 0/3] fixed broken level conversion and one strncmp issue Zhilong Liu
2017-10-09  8:21 ` [PATCH 1/3] mdadm/Grow: fix the broken raid level conversion Zhilong Liu
2017-10-09 10:49   ` NeilBrown
2017-10-10  8:46     ` Zhilong Liu
2017-10-10 20:31       ` NeilBrown
2017-10-11  8:53   ` [PATCH v2] mdadm/grow: adding a test to ensure resize was required Zhilong Liu
2017-10-11 17:31     ` Jes Sorensen
2017-10-12 10:55       ` Majchrzak, Tomasz
2017-10-23 16:43         ` Jes Sorensen
2017-10-24  6:21           ` Zhilong Liu
2017-11-22 10:07             ` Tomasz Majchrzak
2017-10-18  8:01       ` Zhilong Liu [this message]
2017-10-11 19:44     ` John Stoffel
2017-10-12  3:25       ` Zhilong Liu
2017-10-23  9:13     ` [PATCH v3] " Zhilong Liu
2017-10-09  8:21 ` [PATCH 2/3] mdadm/mdstat: fixup a number of '==' broken formatting Zhilong Liu
2017-10-10 20:37   ` Jes Sorensen
2017-10-09  8:21 ` [PATCH 3/3] mdadm/mdstat: correct the strncmp number 4 as 6 Zhilong Liu
2017-10-10 20:38   ` Jes Sorensen

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=c3ec4c9d-f7ff-db9a-325c-ff107bdd6690@suse.com \
    --to=zlliu@suse.com \
    --cc=jes.sorensen@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    /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).