dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/0039-Init-devlist-as-an-array.patch

6e099e
From 8063fd0f9e8abd718bd65928c19bc607cee5acd8 Mon Sep 17 00:00:00 2001
6e099e
From: Xiao Ni <xni@redhat.com>
6e099e
Date: Mon, 30 Sep 2019 19:47:59 +0800
6e099e
Subject: [RHEL7.8 PATCH V2 39/47] Init devlist as an array
6e099e
6e099e
devlist is an string. It will change to an array if there is disk that
6e099e
is sbd disk. If one device is sbd, it runs devlist=().
6e099e
This line code changes devlist from a string to an array. If there is
6e099e
no sbd device, it can't run this line code. So it will still be a string.
6e099e
The later codes need an array, rather than an string. So init devlist
6e099e
as an array to fix this problem.
6e099e
6e099e
Signed-off-by: Xiao Ni <xni@redhat.com>
6e099e
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
6e099e
---
6e099e
 clustermd_tests/func.sh | 3 +++
6e099e
 1 file changed, 3 insertions(+)
6e099e
6e099e
diff --git a/clustermd_tests/func.sh b/clustermd_tests/func.sh
6e099e
index 642cc96..801d604 100644
6e099e
--- a/clustermd_tests/func.sh
6e099e
+++ b/clustermd_tests/func.sh
6e099e
@@ -39,6 +39,9 @@ fetch_devlist()
6e099e
 		devlist=($(ls /dev/disk/by-path/*$ISCSI_ID*))
6e099e
 	fi
6e099e
 	# sbd disk cannot use in testing
6e099e
+	# Init devlist as an array
6e099e
+	i=''
6e099e
+	devlist=(${devlist[@]#$i})
6e099e
 	for i in ${devlist[@]}
6e099e
 	do
6e099e
 		sbd -d $i dump &> /dev/null
6e099e
-- 
6e099e
2.7.5
6e099e