[SCSI] add new SDEV_TRANSPORT_OFFLINE state
authorMike Christie <michaelc@cs.wisc.edu>
Fri, 18 May 2012 04:56:56 +0000 (23:56 -0500)
committerJames Bottomley <JBottomley@Parallels.com>
Fri, 20 Jul 2012 07:58:21 +0000 (08:58 +0100)
commit1b8d26206134458044b0689f48194af00c96d406
tree767d6fa1ed7cb5385daecac13b4fbf2fdc8267c0
parent87098bdd100497ceac0797c6b2f4c51eea1f1e42
[SCSI] add new SDEV_TRANSPORT_OFFLINE state

This patch adds a new state SDEV_TRANSPORT_OFFLINE. It will
be used by transport classes to offline devices for cases like
when the fast_io_fail/recovery_tmo fires. In those cases we
want all IO to fail, and we have not yet escalated to dev_loss_tmo
behavior where we are removing the devices.

Currently to handle this state, transport classes are setting
the scsi_device's state to running, setting their internal
session/port structs state to something that indicates failed,
and then failing IO from some transport check in the queuecommand.

The reason for the new value is so that users can distinguish
between a device failure that is a result of a transport problem
vs the wide range of errors that devices get offlined for
when a scsi command times out and we offline the devices there.
It also fixes the confusion as to why the transport class is
failing IO, but has set the device state from blocked to running.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_sysfs.c
include/scsi/scsi_device.h