* [PATCH -v4 1/1] mdadm/test: Add one test case for raid5 reshape
@ 2017-07-20 7:58 Xiao Ni
2017-08-28 9:31 ` Zhilong Liu
2017-08-28 21:19 ` Jes Sorensen
0 siblings, 2 replies; 5+ messages in thread
From: Xiao Ni @ 2017-07-20 7:58 UTC (permalink / raw)
To: linux-raid; +Cc: jes.sorensen
This case tries to allow raid5 reshape to use backwards direction.
It changes chunksize after reshape and stops the raid. Then starts
the raid again.
Signed-off-by: Xiao Ni <xni@redhat.com>
Suggested-by: Jes Sorensen <jes.sorensen@gmail.com>
Suggested-by: Zhilong Liu <zlliu@suse.com>
Suggested-by: Paul Menzel <pmenzel@molgen.mpg.de>
---
test | 7 +++++++
tests/02r5grow | 17 +++++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/test b/test
index 87e2df2..98e2981 100755
--- a/test
+++ b/test
@@ -320,6 +320,13 @@ check() {
grep -sq "inactive" /proc/mdstat ||
die "array is not inactive!"
;;
+ # It only can be used when there is only one raid
+ chunk )
+ chunk_size=`awk -F',' '/chunk/{print $2}' /proc/mdstat | awk -F'[a-z]' '{print $1}'`
+ if [ "$chunk_size" -ne "$2" ] ; then
+ die "chunksize should be $2, but it's $chunk_size"
+ fi
+ ;;
* )
die "unknown check $1"
;;
diff --git a/tests/02r5grow b/tests/02r5grow
index 386e82e..ea3101b 100644
--- a/tests/02r5grow
+++ b/tests/02r5grow
@@ -34,3 +34,20 @@ check nosync
sh tests/testdev $md0 3 $[size/2] 128
mdadm -S $md0
+
+# create a raid5 array and change the chunk
+mdadm -CR $md0 --level raid5 --metadata=1.1 --chunk=32 --raid-disks 3 --size $[size/2] $dev1 $dev2 $dev3
+check wait
+check state UUU
+check chunk 32
+
+mdadm $md0 --grow --chunk=64
+check reshape
+check wait
+check chunk 64
+
+mdadm -S $md0
+mdadm -As
+check state UUU
+check chunk 64
+mdadm -Ss
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH -v4 1/1] mdadm/test: Add one test case for raid5 reshape
2017-07-20 7:58 [PATCH -v4 1/1] mdadm/test: Add one test case for raid5 reshape Xiao Ni
@ 2017-08-28 9:31 ` Zhilong Liu
2017-08-28 21:19 ` Jes Sorensen
1 sibling, 0 replies; 5+ messages in thread
From: Zhilong Liu @ 2017-08-28 9:31 UTC (permalink / raw)
To: Xiao Ni, jes.sorensen; +Cc: linux-raid
Hi, Jes;
Kind reminder for this commit.
Thanks,
-Zhilong
On 07/20/2017 03:58 PM, Xiao Ni wrote:
> This case tries to allow raid5 reshape to use backwards direction.
> It changes chunksize after reshape and stops the raid. Then starts
> the raid again.
>
> Signed-off-by: Xiao Ni <xni@redhat.com>
> Suggested-by: Jes Sorensen <jes.sorensen@gmail.com>
> Suggested-by: Zhilong Liu <zlliu@suse.com>
> Suggested-by: Paul Menzel <pmenzel@molgen.mpg.de>
> ---
> test | 7 +++++++
> tests/02r5grow | 17 +++++++++++++++++
> 2 files changed, 24 insertions(+)
>
> diff --git a/test b/test
> index 87e2df2..98e2981 100755
> --- a/test
> +++ b/test
> @@ -320,6 +320,13 @@ check() {
> grep -sq "inactive" /proc/mdstat ||
> die "array is not inactive!"
> ;;
> + # It only can be used when there is only one raid
> + chunk )
> + chunk_size=`awk -F',' '/chunk/{print $2}' /proc/mdstat | awk -F'[a-z]' '{print $1}'`
> + if [ "$chunk_size" -ne "$2" ] ; then
> + die "chunksize should be $2, but it's $chunk_size"
> + fi
> + ;;
> * )
> die "unknown check $1"
> ;;
> diff --git a/tests/02r5grow b/tests/02r5grow
> index 386e82e..ea3101b 100644
> --- a/tests/02r5grow
> +++ b/tests/02r5grow
> @@ -34,3 +34,20 @@ check nosync
> sh tests/testdev $md0 3 $[size/2] 128
>
> mdadm -S $md0
> +
> +# create a raid5 array and change the chunk
> +mdadm -CR $md0 --level raid5 --metadata=1.1 --chunk=32 --raid-disks 3 --size $[size/2] $dev1 $dev2 $dev3
> +check wait
> +check state UUU
> +check chunk 32
> +
> +mdadm $md0 --grow --chunk=64
> +check reshape
> +check wait
> +check chunk 64
> +
> +mdadm -S $md0
> +mdadm -As
> +check state UUU
> +check chunk 64
> +mdadm -Ss
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH -v4 1/1] mdadm/test: Add one test case for raid5 reshape
2017-07-20 7:58 [PATCH -v4 1/1] mdadm/test: Add one test case for raid5 reshape Xiao Ni
2017-08-28 9:31 ` Zhilong Liu
@ 2017-08-28 21:19 ` Jes Sorensen
2017-08-30 8:54 ` Xiao Ni
1 sibling, 1 reply; 5+ messages in thread
From: Jes Sorensen @ 2017-08-28 21:19 UTC (permalink / raw)
To: Xiao Ni, linux-raid
On 07/20/2017 03:58 AM, Xiao Ni wrote:
> This case tries to allow raid5 reshape to use backwards direction.
> It changes chunksize after reshape and stops the raid. Then starts
> the raid again.
>
> Signed-off-by: Xiao Ni <xni@redhat.com>
> Suggested-by: Jes Sorensen <jes.sorensen@gmail.com>
> Suggested-by: Zhilong Liu <zlliu@suse.com>
> Suggested-by: Paul Menzel <pmenzel@molgen.mpg.de>
> ---
> test | 7 +++++++
> tests/02r5grow | 17 +++++++++++++++++
> 2 files changed, 24 insertions(+)
>
> diff --git a/test b/test
> index 87e2df2..98e2981 100755
> --- a/test
> +++ b/test
> @@ -320,6 +320,13 @@ check() {
> grep -sq "inactive" /proc/mdstat ||
> die "array is not inactive!"
> ;;
> + # It only can be used when there is only one raid
> + chunk )
> + chunk_size=`awk -F',' '/chunk/{print $2}' /proc/mdstat | awk -F'[a-z]' '{print $1}'`
> + if [ "$chunk_size" -ne "$2" ] ; then
> + die "chunksize should be $2, but it's $chunk_size"
> + fi
> + ;;
> * )
> die "unknown check $1"
> ;;
> diff --git a/tests/02r5grow b/tests/02r5grow
> index 386e82e..ea3101b 100644
> --- a/tests/02r5grow
> +++ b/tests/02r5grow
> @@ -34,3 +34,20 @@ check nosync
> sh tests/testdev $md0 3 $[size/2] 128
>
> mdadm -S $md0
> +
> +# create a raid5 array and change the chunk
> +mdadm -CR $md0 --level raid5 --metadata=1.1 --chunk=32 --raid-disks 3 --size $[size/2] $dev1 $dev2 $dev3
> +check wait
> +check state UUU
> +check chunk 32
> +
> +mdadm $md0 --grow --chunk=64
> +check reshape
> +check wait
> +check chunk 64
> +
> +mdadm -S $md0
> +mdadm -As
> +check state UUU
> +check chunk 64
> +mdadm -Ss
Hi Xiao,
I don't like the last part running 'mdadm -As' this will auto-assemble
any array in the system and you can get a false test failure because it
will assume the first assembled array is the one you are looking for.
Cheers,
Jes
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH -v4 1/1] mdadm/test: Add one test case for raid5 reshape
2017-08-28 21:19 ` Jes Sorensen
@ 2017-08-30 8:54 ` Xiao Ni
2017-08-30 9:00 ` Zhilong Liu
0 siblings, 1 reply; 5+ messages in thread
From: Xiao Ni @ 2017-08-30 8:54 UTC (permalink / raw)
To: Jes Sorensen; +Cc: linux-raid
----- Original Message -----
> From: "Jes Sorensen" <jes.sorensen@gmail.com>
> To: "Xiao Ni" <xni@redhat.com>, linux-raid@vger.kernel.org
> Sent: Tuesday, August 29, 2017 5:19:22 AM
> Subject: Re: [PATCH -v4 1/1] mdadm/test: Add one test case for raid5 reshape
>
> On 07/20/2017 03:58 AM, Xiao Ni wrote:
> > This case tries to allow raid5 reshape to use backwards direction.
> > It changes chunksize after reshape and stops the raid. Then starts
> > the raid again.
> >
> > Signed-off-by: Xiao Ni <xni@redhat.com>
> > Suggested-by: Jes Sorensen <jes.sorensen@gmail.com>
> > Suggested-by: Zhilong Liu <zlliu@suse.com>
> > Suggested-by: Paul Menzel <pmenzel@molgen.mpg.de>
> > ---
> > test | 7 +++++++
> > tests/02r5grow | 17 +++++++++++++++++
> > 2 files changed, 24 insertions(+)
> >
> > diff --git a/test b/test
> > index 87e2df2..98e2981 100755
> > --- a/test
> > +++ b/test
> > @@ -320,6 +320,13 @@ check() {
> > grep -sq "inactive" /proc/mdstat ||
> > die "array is not inactive!"
> > ;;
> > + # It only can be used when there is only one raid
> > + chunk )
> > + chunk_size=`awk -F',' '/chunk/{print $2}' /proc/mdstat | awk -F'[a-z]'
> > '{print $1}'`
> > + if [ "$chunk_size" -ne "$2" ] ; then
> > + die "chunksize should be $2, but it's $chunk_size"
> > + fi
> > + ;;
> > * )
> > die "unknown check $1"
> > ;;
> > diff --git a/tests/02r5grow b/tests/02r5grow
> > index 386e82e..ea3101b 100644
> > --- a/tests/02r5grow
> > +++ b/tests/02r5grow
> > @@ -34,3 +34,20 @@ check nosync
> > sh tests/testdev $md0 3 $[size/2] 128
> >
> > mdadm -S $md0
> > +
> > +# create a raid5 array and change the chunk
> > +mdadm -CR $md0 --level raid5 --metadata=1.1 --chunk=32 --raid-disks 3
> > --size $[size/2] $dev1 $dev2 $dev3
> > +check wait
> > +check state UUU
> > +check chunk 32
> > +
> > +mdadm $md0 --grow --chunk=64
> > +check reshape
> > +check wait
> > +check chunk 64
> > +
> > +mdadm -S $md0
> > +mdadm -As
> > +check state UUU
> > +check chunk 64
> > +mdadm -Ss
>
> Hi Xiao,
>
> I don't like the last part running 'mdadm -As' this will auto-assemble
> any array in the system and you can get a false test failure because it
> will assume the first assembled array is the one you are looking for.
Hi Jes
Is it ok to change mdadm -As to mdadm -A $md0 $dev1 $dev2 $dev3
Regards
Xiao
>
> Cheers,
> 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
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH -v4 1/1] mdadm/test: Add one test case for raid5 reshape
2017-08-30 8:54 ` Xiao Ni
@ 2017-08-30 9:00 ` Zhilong Liu
0 siblings, 0 replies; 5+ messages in thread
From: Zhilong Liu @ 2017-08-30 9:00 UTC (permalink / raw)
To: Xiao Ni, Jes Sorensen; +Cc: linux-raid
On 08/30/2017 04:54 PM, Xiao Ni wrote:
>
> ----- Original Message -----
>> From: "Jes Sorensen" <jes.sorensen@gmail.com>
>> To: "Xiao Ni" <xni@redhat.com>, linux-raid@vger.kernel.org
>> Sent: Tuesday, August 29, 2017 5:19:22 AM
>> Subject: Re: [PATCH -v4 1/1] mdadm/test: Add one test case for raid5 reshape
>>
>> On 07/20/2017 03:58 AM, Xiao Ni wrote:
>>> This case tries to allow raid5 reshape to use backwards direction.
>>> It changes chunksize after reshape and stops the raid. Then starts
>>> the raid again.
>>>
>>> Signed-off-by: Xiao Ni <xni@redhat.com>
>>> Suggested-by: Jes Sorensen <jes.sorensen@gmail.com>
>>> Suggested-by: Zhilong Liu <zlliu@suse.com>
>>> Suggested-by: Paul Menzel <pmenzel@molgen.mpg.de>
>>> ---
>>> test | 7 +++++++
>>> tests/02r5grow | 17 +++++++++++++++++
>>> 2 files changed, 24 insertions(+)
>>>
>>> diff --git a/test b/test
>>> index 87e2df2..98e2981 100755
>>> --- a/test
>>> +++ b/test
>>> @@ -320,6 +320,13 @@ check() {
>>> grep -sq "inactive" /proc/mdstat ||
>>> die "array is not inactive!"
>>> ;;
>>> + # It only can be used when there is only one raid
>>> + chunk )
>>> + chunk_size=`awk -F',' '/chunk/{print $2}' /proc/mdstat | awk -F'[a-z]'
>>> '{print $1}'`
>>> + if [ "$chunk_size" -ne "$2" ] ; then
>>> + die "chunksize should be $2, but it's $chunk_size"
>>> + fi
>>> + ;;
>>> * )
>>> die "unknown check $1"
>>> ;;
>>> diff --git a/tests/02r5grow b/tests/02r5grow
>>> index 386e82e..ea3101b 100644
>>> --- a/tests/02r5grow
>>> +++ b/tests/02r5grow
>>> @@ -34,3 +34,20 @@ check nosync
>>> sh tests/testdev $md0 3 $[size/2] 128
>>>
>>> mdadm -S $md0
>>> +
>>> +# create a raid5 array and change the chunk
>>> +mdadm -CR $md0 --level raid5 --metadata=1.1 --chunk=32 --raid-disks 3
>>> --size $[size/2] $dev1 $dev2 $dev3
>>> +check wait
>>> +check state UUU
>>> +check chunk 32
>>> +
>>> +mdadm $md0 --grow --chunk=64
>>> +check reshape
>>> +check wait
>>> +check chunk 64
>>> +
>>> +mdadm -S $md0
>>> +mdadm -As
>>> +check state UUU
>>> +check chunk 64
>>> +mdadm -Ss
>> Hi Xiao,
>>
>> I don't like the last part running 'mdadm -As' this will auto-assemble
>> any array in the system and you can get a false test failure because it
>> will assume the first assembled array is the one you are looking for.
> Hi Jes
>
> Is it ok to change mdadm -As to mdadm -A $md0 $dev1 $dev2 $dev3
Small opinion, also change "mdadm -Ss" to "mdadm -S $md0".
Thanks,
-Zhilong
> Regards
> Xiao
>> Cheers,
>> 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
>>
> --
> 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
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-08-30 9:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-20 7:58 [PATCH -v4 1/1] mdadm/test: Add one test case for raid5 reshape Xiao Ni
2017-08-28 9:31 ` Zhilong Liu
2017-08-28 21:19 ` Jes Sorensen
2017-08-30 8:54 ` Xiao Ni
2017-08-30 9:00 ` Zhilong Liu
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).