diff options
author | Bart Van Assche <bvanassche@acm.org> | 2013-07-02 09:06:33 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-07-09 07:14:09 -0400 |
commit | 0516c08d10835a8f9169051504cbc9929b3a7f3e (patch) | |
tree | 28671d233448c817cf9c91979d44152277e2a4a8 /drivers/scsi | |
parent | e2eb7244bc9e4fd130fc8a961224968e22ba48ee (diff) |
[SCSI] enable destruction of blocked devices which fail LUN scanning
If something goes wrong during LUN scanning, e.g. a transport layer
failure occurs, then __scsi_remove_device() can get invoked by the
LUN scanning code for a SCSI device in state SDEV_CREATED_BLOCK and
before the SCSI device has been added to sysfs (is_visible == 0).
Make sure that even in this case the transition into state SDEV_DEL
occurs. This avoids that __scsi_remove_device() can get invoked a
second time by scsi_forget_host() if this last function is invoked
from another thread than the thread that performs LUN scanning.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index df8bd5ab3c0b..124392f3091e 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -2193,6 +2193,7 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) | |||
2193 | case SDEV_OFFLINE: | 2193 | case SDEV_OFFLINE: |
2194 | case SDEV_TRANSPORT_OFFLINE: | 2194 | case SDEV_TRANSPORT_OFFLINE: |
2195 | case SDEV_CANCEL: | 2195 | case SDEV_CANCEL: |
2196 | case SDEV_CREATED_BLOCK: | ||
2196 | break; | 2197 | break; |
2197 | default: | 2198 | default: |
2198 | goto illegal; | 2199 | goto illegal; |