]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[SCSI] scsi_lib: Set the device state from transport-offline to running
authorVikas Chaudhary <vikas.chaudhary@qlogic.com>
Thu, 9 Aug 2012 08:51:30 +0000 (04:51 -0400)
committerJames Bottomley <JBottomley@Parallels.com>
Fri, 14 Sep 2012 16:59:22 +0000 (17:59 +0100)
FC and iSCSI class set SCSI devices to transport-offline state after
fast_io_fail/replacement_timeout has fired, but after relogin, function
scsi_internal_device_unblock() is not setting scsi device state to running.
Due to this the devices even after being relogged in remain offline.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/scsi_lib.c

index ffd77739ae3e2bc4bf793fe7b4bb0ed37c3ca8f4..4ba37198e069856c2b6b061e681d1c54955e2eb4 100644 (file)
@@ -2470,7 +2470,8 @@ scsi_internal_device_unblock(struct scsi_device *sdev,
         * Try to transition the scsi device to SDEV_RUNNING or one of the
         * offlined states and goose the device queue if successful.
         */
-       if (sdev->sdev_state == SDEV_BLOCK)
+       if ((sdev->sdev_state == SDEV_BLOCK) ||
+           (sdev->sdev_state == SDEV_TRANSPORT_OFFLINE))
                sdev->sdev_state = new_state;
        else if (sdev->sdev_state == SDEV_CREATED_BLOCK) {
                if (new_state == SDEV_TRANSPORT_OFFLINE ||