21.16. Modifying Link Loss Behavior
This section describes how to modify the link loss behavior of devices that use either fibre channel or iSCSI protocols.
If a driver implements the Transport dev_loss_tmo
callback, access attempts to a device through a link will be blocked when a transport problem is detected. To verify if a device is blocked, run the following command:
cat /sys/block/device
/device/state
This command will return blocked
if the device is blocked. If the device is operating normally, this command will return running
.
Procedure 21.5. Determining The State of a Remote Port
-
To determine the state of a remote port, run the following command:
cat /sys/class/fc_remote_port/rport-H
:B
:R
/port_state
-
This command will return Blocked
when the remote port (along with devices accessed through it) are blocked. If the remote port is operating normally, the command will return Online
.
-
If the problem is not resolved within dev_loss_tmo
seconds, the rport and devices will be unblocked and all I/O running on that device (along with any new I/O sent to that device) will be failed.
Procedure 21.6. Changing dev_loss_tmo
-
To change the dev_loss_tmo
value, echo
in the desired value to the file. For example, to set dev_loss_tmo
to 30 seconds, run:
echo 30 > /sys/class/fc_remote_port/rport-H
:B
:R
/dev_loss_tmo
When a device is blocked, the fibre channel class will leave the device as is; i.e. /dev/sdx
will remain /dev/sdx
. This is because the dev_loss_tmo
expired. If the link problem is fixed at a later time, operations will continue using the same SCSI device and device node name.
Fibre Channel: remove_on_dev_loss
If you prefer that devices are removed at the SCSI layer when links are marked bad (i.e. expired after dev_loss_tmo
seconds), you can use the scsi_transport_fc
module parameter remove_on_dev_loss
. When a device is removed at the SCSI layer while remove_on_dev_loss
is in effect, the device will be added back once all transport problems are corrected.
The use of remove_on_dev_loss
is not recommended, as removing a device at the SCSI layer does not automatically unmount any file systems from that device. When file systems from a removed device are left mounted, the device may not be properly removed from multipath or RAID devices.
Further problems may arise from this if the upper layers are not hotplug-aware. This is because the upper layers may still be holding references to the state of the device before it was originally removed. This can cause unexpected behavior when the device is added again.