From 0761bca64df806d766f967576ddf00df6d8cf6c4 Mon Sep 17 00:00:00 2001 From: Hannes Reinecke Date: Wed, 27 Mar 2019 17:40:03 +0800 Subject: [PATCH] scsi: core: Allow state transitions from OFFLINE to BLOCKED mainline inclusion from mainline-4.20-rc1 commit a33e5bfb29721015349a3864c91abe11f6195d5c category: bugfix bugzilla: 10015 CVE: NA --------------------------- When an RSCN gets delayed (or not being sent at all), the transport class will detect an error, EH kicks in, and eventually will be setting the device to offline. If we receive an RSCN after that, the device will stay in 'offline'. This patch allows for an 'offline' to 'blocked' transition, thereby allowing the device to become active again. Signed-off-by: Hannes Reinecke Signed-off-by: Martin K. Petersen Signed-off-by: zhengbin Reviewed-by: Jason Yan Signed-off-by: Yang Yingliang --- drivers/scsi/scsi_lib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 352f2daa6123..292829da23bd 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -2762,6 +2762,7 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) switch (oldstate) { case SDEV_RUNNING: case SDEV_CREATED_BLOCK: + case SDEV_OFFLINE: break; default: goto illegal; -- GitLab