diff options
author | Neil Brown <neilb@suse.de> | 2005-09-12 05:23:11 +0000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2005-09-12 05:23:11 +0000 |
commit | 308e1801baa05edbcfda6e8054fdf90727581c62 (patch) | |
tree | 5793bfc567206cc898a1fb9cf5812275038fffcc /test | |
parent | 265e0f17317e6d23864263c04ae581b35f946b5e (diff) | |
download | mdadm-308e1801baa05edbcfda6e8054fdf90727581c62.tar.gz mdadm-308e1801baa05edbcfda6e8054fdf90727581c62.tar.xz mdadm-308e1801baa05edbcfda6e8054fdf90727581c62.zip |
Fix assembling of array with spares when verion-1 superblock is used.
As spared don't have a position in the raid array with verion-1 superblocks,
we need to handle them a bit differently.
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'test')
-rw-r--r-- | test | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -60,12 +60,19 @@ path1=$dev7 # mdadm always adds --quiet, and we want to see any unexpected messages mdadm() { - $mdadm 2>&1 --quiet "$@" + $mdadm --quiet "$@" } # check various things check() { case $1 in + spares ) + spares=`tr '] ' '\012\012' < /proc/mdstat | grep -c '(S)' || exit 0` + if [ $spares -ne $2 ] + then + echo >&2 "ERROR expected $2 spares, found $spares"; exit 1; + fi + ;; raid* | linear ) grep -s "active $1 " /proc/mdstat > /dev/null || { echo >&2 "ERROR active $1 not found" ; cat /proc/mdstat ; exit 1;} |