diff options
author | Neil Brown <neilb@suse.de> | 2005-09-12 07:24:10 +0200 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2005-09-12 07:24:10 +0200 |
commit | f6d75de8e0106a3789ed1a3aada306d197531e47 (patch) | |
tree | 9c6941767308f8fcb13f179f99eafbb38be73cf4 /tests/05r5-bitmapfile | |
parent | Fix assembling of array with spares when verion-1 superblock is used. (diff) | |
download | mdadm-f6d75de8e0106a3789ed1a3aada306d197531e47.tar.xz mdadm-f6d75de8e0106a3789ed1a3aada306d197531e47.zip |
Fix remaining problems with hot-add bitmap to version-1 superblock
Also some more tests - r5 and r6 bitmaps
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'tests/05r5-bitmapfile')
-rw-r--r-- | tests/05r5-bitmapfile | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/05r5-bitmapfile b/tests/05r5-bitmapfile new file mode 100644 index 00000000..25c12287 --- /dev/null +++ b/tests/05r5-bitmapfile @@ -0,0 +1,48 @@ + +# +# create a raid1 with a bitmap file +# +bmf=$targetdir/bitmap +rm -f $bmf +mdadm --create --run $md0 --level=5 -n3 --delay=1 --bitmap $bmf $dev1 $dev2 $dev3 +check wait +testdev $md0 2 $mdsize0 1 +mdadm -S $md0 + +mdadm --assemble $md0 --bitmap=$bmf $dev1 $dev2 $dev3 +testdev $md0 2 $mdsize0 1 +dirty1=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` +sleep 4 +dirty2=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` + +if [ $dirty1 -lt 400 -o $dirty2 -ne 0 ] +then echo >&2 "ERROR bad 'dirty' counts: $dirty1 and $dirty2" + exit 1 +fi +mdadm $md0 -f $dev1 +testdev $md0 2 $mdsize0 1 +sleep 4 +dirty3=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` +if [ $dirty3 -lt 400 ] +then + echo >&2 "ERROR dirty count $dirty3 is too small" + exit 2 +fi + +mdadm -S $md0 + +mdadm --assemble -R $md0 --bitmap=$bmf $dev2 $dev3 +mdadm $md0 --add $dev1 +check recovery + +dirty4=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` +check wait +sleep 4 +dirty5=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` + +if [ $dirty4 -lt 400 -o $dirty5 -ne 0 ] +then echo echo >&2 "ERROR bad 'dirty' counts at end: $dirty4 $dirty5" + exit 1 +fi + +mdadm -S $md0 |