Skip to content

Commit 7374943

Browse files
tblumejohannbg
authored andcommitted
fix(iscsi): add support for the new iscsiadm "no-wait" (-W) command
remove connection timeout for iscsi firmware targets serving system root
1 parent c86f4d2 commit 7374943

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

modules.d/95iscsi/iscsiroot.sh

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ if [ -z "${DRACUT_SYSTEMD}" ] \
4545
fi
4646

4747
handle_firmware() {
48-
local ifaces retry
48+
local ifaces retry _res
4949

5050
# Depending on the 'ql4xdisablesysfsboot' qla4xxx
5151
# will be autostarting sessions without presenting
@@ -69,9 +69,28 @@ handle_firmware() {
6969
rm /tmp/session-retry
7070
fi
7171

72-
if ! iscsiadm -m fw -l; then
72+
# check to see if we have the new iscsiadm command,
73+
# that supports the "no-wait" (-W) flag. If so, use it.
74+
iscsiadm -m fw -l -W 2> /dev/null
75+
_res=$?
76+
if [ $_res -eq 7 ]; then
77+
# ISCSI_ERR_INVALID (7) => "-W" not supported
78+
info "iscsiadm does not support no-wait firmware logins"
79+
iscsiadm -m fw -l
80+
_res=$?
81+
fi
82+
if [ $_res -ne 0 ]; then
7383
warn "iscsiadm: Log-in to iscsi target failed"
7484
else
85+
# get a list of connected targets
86+
tgts=$(cat /sys/firmware/ibft/target*/target-name | sort -u)
87+
# disable NOPs for each FW target
88+
for tgt in ${tgts}; do
89+
iscsiadm -m node -T "${tgt}" \
90+
--op update \
91+
--name 'node.conn[0].timeo.noop_out_interval' --value 0 \
92+
--name 'node.conn[0].timeo.noop_out_timeout' --value 0
93+
done
7594
need_shutdown
7695
fi
7796
fi

modules.d/95iscsi/module-setup.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ install() {
188188
inst_multiple -o iscsiuio
189189
inst_libdir_file 'libgcc_s.so*'
190190
inst_multiple umount iscsi-iname iscsiadm iscsid
191+
inst_binary sort
191192

192193
inst_multiple -o \
193194
"$systemdsystemunitdir"/iscsid.socket \

0 commit comments

Comments
 (0)