dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

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

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