* [PATCH -v2 1/1] mdadm/test: Add one test case for raid5 reshape
@ 2017-07-17 9:27 Xiao Ni
2017-07-18 4:37 ` Zhilong Liu
0 siblings, 1 reply; 3+ messages in thread
From: Xiao Ni @ 2017-07-17 9:27 UTC (permalink / raw)
To: linux-raid; +Cc: jes.sorensen
This case trys to allow raid5 reshape to use backwards direction.
It changes chunksize after reshape and stop the raid. Then start
the raid again.
Signed-off-by: Xiao Ni <xni@redhat.com>
---
tests/02r5grow | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/tests/02r5grow b/tests/02r5grow
index 386e82e..64c5599 100644
--- a/tests/02r5grow
+++ b/tests/02r5grow
@@ -34,3 +34,16 @@ 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
+
+mdadm $md0 --grow --chunk=64
+check reshape
+check wait
+
+mdadm -S $md0
+mdadm -As
+check state UUU
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -v2 1/1] mdadm/test: Add one test case for raid5 reshape
2017-07-17 9:27 [PATCH -v2 1/1] mdadm/test: Add one test case for raid5 reshape Xiao Ni
@ 2017-07-18 4:37 ` Zhilong Liu
2017-07-18 8:43 ` Xiao Ni
0 siblings, 1 reply; 3+ messages in thread
From: Zhilong Liu @ 2017-07-18 4:37 UTC (permalink / raw)
To: Xiao Ni, linux-raid; +Cc: jes.sorensen
On 07/17/2017 05:27 PM, Xiao Ni wrote:
> This case trys to allow raid5 reshape to use backwards direction.
> It changes chunksize after reshape and stop the raid. Then start
> the raid again.
>
> Signed-off-by: Xiao Ni <xni@redhat.com>
> ---
> tests/02r5grow | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/tests/02r5grow b/tests/02r5grow
> index 386e82e..64c5599 100644
> --- a/tests/02r5grow
> +++ b/tests/02r5grow
> @@ -34,3 +34,16 @@ 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
> +
Hi,
Just my opinion, it should check the chunk-size properly if you
wanna test 'chunk'.
Maybe can do following three things in a function.
From sysfs:
new_size=$(cat /sys/block/md0/md/chunk_size)
if [ "$(expr 32 \* 1024)" -eq "$new_size" ]; then
...
fi
From procfs:
# cat /proc/mdstat | awk -F',' '/chunk/{print $2}'
32k chunk
From superblock:
mdadm -D /dev/md0 | grep "Chunk Size"
It's important for testing based on expected environment.
> +mdadm $md0 --grow --chunk=64
> +check reshape
> +check wait
Here too.
> +
> +mdadm -S $md0
> +mdadm -As
> +check state UUU
Also here.
Thanks,
-Zhilong
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH -v2 1/1] mdadm/test: Add one test case for raid5 reshape
2017-07-18 4:37 ` Zhilong Liu
@ 2017-07-18 8:43 ` Xiao Ni
0 siblings, 0 replies; 3+ messages in thread
From: Xiao Ni @ 2017-07-18 8:43 UTC (permalink / raw)
To: Zhilong Liu; +Cc: linux-raid, jes sorensen
----- Original Message -----
> From: "Zhilong Liu" <zlliu@suse.com>
> To: "Xiao Ni" <xni@redhat.com>, linux-raid@vger.kernel.org
> Cc: "jes sorensen" <jes.sorensen@gmail.com>
> Sent: Tuesday, July 18, 2017 12:37:32 PM
> Subject: Re: [PATCH -v2 1/1] mdadm/test: Add one test case for raid5 reshape
>
>
>
> On 07/17/2017 05:27 PM, Xiao Ni wrote:
> > This case trys to allow raid5 reshape to use backwards direction.
> > It changes chunksize after reshape and stop the raid. Then start
> > the raid again.
> >
> > Signed-off-by: Xiao Ni <xni@redhat.com>
> > ---
> > tests/02r5grow | 13 +++++++++++++
> > 1 file changed, 13 insertions(+)
> >
> > diff --git a/tests/02r5grow b/tests/02r5grow
> > index 386e82e..64c5599 100644
> > --- a/tests/02r5grow
> > +++ b/tests/02r5grow
> > @@ -34,3 +34,16 @@ 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
> > +
>
> Hi,
> Just my opinion, it should check the chunk-size properly if you
> wanna test 'chunk'.
> Maybe can do following three things in a function.
>
> From sysfs:
> new_size=$(cat /sys/block/md0/md/chunk_size)
> if [ "$(expr 32 \* 1024)" -eq "$new_size" ]; then
> ...
> fi
>
> From procfs:
> # cat /proc/mdstat | awk -F',' '/chunk/{print $2}'
> 32k chunk
>
> From superblock:
> mdadm -D /dev/md0 | grep "Chunk Size"
>
> It's important for testing based on expected environment.
>
> > +mdadm $md0 --grow --chunk=64
> > +check reshape
> > +check wait
>
> Here too.
>
> > +
> > +mdadm -S $md0
> > +mdadm -As
> > +check state UUU
>
> Also here.
Thanks for these suggestions. I'll add this check too.
Regards
Xiao
>
> Thanks,
> -Zhilong
> --
> 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] 3+ messages in thread
end of thread, other threads:[~2017-07-18 8:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-17 9:27 [PATCH -v2 1/1] mdadm/test: Add one test case for raid5 reshape Xiao Ni
2017-07-18 4:37 ` Zhilong Liu
2017-07-18 8:43 ` Xiao Ni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox