]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/scsi/scsi_lib.c
[SCSI] Fix regressions in scsi_internal_device_block
[mirror_ubuntu-artful-kernel.git] / drivers / scsi / scsi_lib.c
index 8041fe1ab179c2c2e77386726b8082c05643b187..eafeeda6e1942b7deda691f940c0f10efddee390 100644 (file)
@@ -2438,7 +2438,8 @@ scsi_internal_device_unblock(struct scsi_device *sdev)
                sdev->sdev_state = SDEV_RUNNING;
        else if (sdev->sdev_state == SDEV_CREATED_BLOCK)
                sdev->sdev_state = SDEV_CREATED;
-       else
+       else if (sdev->sdev_state != SDEV_CANCEL &&
+                sdev->sdev_state != SDEV_OFFLINE)
                return -EINVAL;
 
        spin_lock_irqsave(q->queue_lock, flags);