diff options
author | Zhilong Liu <zlliu@suse.com> | 2017-08-28 11:24:28 +0200 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2017-09-01 17:22:03 +0200 |
commit | 3af7f2adc097fad519273a817c3ae6ac1f66d32f (patch) | |
tree | 6dae843b0e07a42f35c413584c721b4b5bc4e39e /test | |
parent | mdadm/bitmap: examine-bitmap failed when bitmap is external mode (diff) | |
download | mdadm-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-x | test | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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" |