Skip to content

Commit

Permalink
fix(iscsi): add support for the new iscsiadm "no-wait" (-W) command
Browse files Browse the repository at this point in the history
remove connection timeout for iscsi firmware targets serving system root
  • Loading branch information
tblume authored and johannbg committed Aug 17, 2021
1 parent c86f4d2 commit 7374943
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
23 changes: 21 additions & 2 deletions modules.d/95iscsi/iscsiroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if [ -z "${DRACUT_SYSTEMD}" ] \
fi

handle_firmware() {
local ifaces retry
local ifaces retry _res

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

if ! iscsiadm -m fw -l; then
# check to see if we have the new iscsiadm command,
# that supports the "no-wait" (-W) flag. If so, use it.
iscsiadm -m fw -l -W 2> /dev/null
_res=$?
if [ $_res -eq 7 ]; then
# ISCSI_ERR_INVALID (7) => "-W" not supported
info "iscsiadm does not support no-wait firmware logins"
iscsiadm -m fw -l
_res=$?
fi
if [ $_res -ne 0 ]; then
warn "iscsiadm: Log-in to iscsi target failed"
else
# get a list of connected targets
tgts=$(cat /sys/firmware/ibft/target*/target-name | sort -u)
# disable NOPs for each FW target
for tgt in ${tgts}; do
iscsiadm -m node -T "${tgt}" \
--op update \
--name 'node.conn[0].timeo.noop_out_interval' --value 0 \
--name 'node.conn[0].timeo.noop_out_timeout' --value 0
done
need_shutdown
fi
fi
Expand Down
1 change: 1 addition & 0 deletions modules.d/95iscsi/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ install() {
inst_multiple -o iscsiuio
inst_libdir_file 'libgcc_s.so*'
inst_multiple umount iscsi-iname iscsiadm iscsid
inst_binary sort

inst_multiple -o \
"$systemdsystemunitdir"/iscsid.socket \
Expand Down

0 comments on commit 7374943

Please sign in to comment.