From 7d4145e09879ffbfb9d5b7d24f7d9eb1ae5d1ec5 Mon Sep 17 00:00:00 2001 From: Brian Meagher Date: Mon, 29 Jan 2024 12:31:32 -0800 Subject: [PATCH] When stopping scst turn off cluster_mode in parallel (cherry picked from commit 8a90f7afc0230ba4ae7eb08f4a7d8604a3d1c2b5) --- scstadmin/init.d/scst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scstadmin/init.d/scst b/scstadmin/init.d/scst index 9490e1b29..f7dcb3a01 100755 --- a/scstadmin/init.d/scst +++ b/scstadmin/init.d/scst @@ -269,6 +269,17 @@ stop_scst() { return 1 fi + # Disable iSCSI + if [ -f /sys/kernel/scst_tgt/targets/iscsi/enabled ]; then + echo 0 > /sys/kernel/scst_tgt/targets/iscsi/enabled + fi + + # Turn off any cluster_mode in parallel + for cm in /sys/kernel/scst_tgt/devices/*/cluster_mode ; do + echo 0 > "$cm" & + done + wait + unload_scst }