enable destruction of blocked devices which fail LUN scanning
authorBart Van Assche <bvanassche@acm.org>
Tue, 2 Jul 2013 13:06:33 +0000 (15:06 +0200)
committerJens Axboe <axboe@fb.com>
Thu, 2 Apr 2015 18:12:25 +0000 (12:12 -0600)
commit464745769496b0514e3f4a767744a9b2f639e492
tree7fc79162f6b9824d608b1388efa96e2ec73d6230
parent3893854db000e10d22d518ff40276476c205f129
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>
drivers/scsi/scsi_lib.c