summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorZhilong Liu <zlliu@suse.com>2017-08-28 11:24:28 +0200
committerJes Sorensen <jsorensen@fb.com>2017-09-01 17:22:03 +0200
commit3af7f2adc097fad519273a817c3ae6ac1f66d32f (patch)
tree6dae843b0e07a42f35c413584c721b4b5bc4e39e /test
parentmdadm/bitmap: examine-bitmap failed when bitmap is external mode (diff)
downloadmdadm-3af7f2adc097fad519273a817c3ae6ac1f66d32f.tar.xz
mdadm-3af7f2adc097fad519273a817c3ae6ac1f66d32f.zip
mdadm/test: use the first element of array as parsing condition
it would complain "too many arguments" when array[] has few members, it's proper to check whether or not array[0] is null. Reported-by: Xiao Ni <xni@redhat.com> Signed-off-by: Zhilong Liu <zlliu@suse.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'test')
-rwxr-xr-xtest2
1 files changed, 1 insertions, 1 deletions
diff --git a/test b/test
index 87e2df2d..25268a0f 100755
--- a/test
+++ b/test
@@ -75,7 +75,7 @@ save_log() {
echo
elif [ "$DEVTYPE" == 'loop' -o "$DEVTYPE" == 'disk' ]
then
- if [ ! -z ${array[@]} -a ${#array[@]} -ge 1 ]
+ if [ ! -z "$array" -a ${#array[@]} -ge 1 ]
then
md_disks=($($mdadm -D -Y ${array[@]} | grep "/dev/" | cut -d'=' -f2))
cat /proc/mdstat | grep -q "bitmap"