7.1. Fibre Channel

7.1. Fibre Channel

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 2. Determining The State of a Remote Port
  1. To determine the state of a remote port, run the following command:

    cat /sys/class/rport/rport-H:B:R/port_state

  2. 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.

  3. If the problem is not resolved within dev_loss_tmo seconds, the rport and devices will be unblocked and all IO running on that device (along with any new IO sent to that device) will be failed.

Procedure 3. 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/rport/rport-H:B:R/dev_loss_tmo

For more information about dev_loss_tmo, refer to Section 2.1, “Fibre Channel API”.

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, the SCSI device will be used again.

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.

Warning

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.