>>>>> "Wei" == Wei Fang <fangwei1@xxxxxxxxxx> writes: Wei> A race between scanning and fc_remote_port_delete() may result in a Wei> permanent stop if the device gets blocked before Wei> scsi_sysfs_add_sdev() and unblocked after. The reason is that Wei> blocking a device sets both the SDEV_BLOCKED state and the Wei> QUEUE_FLAG_STOPPED. However, scsi_sysfs_add_sdev() unconditionally Wei> sets SDEV_RUNNING which causes the device to be ignored by Wei> scsi_target_unblock() and thus never have its QUEUE_FLAG_STOPPED Wei> cleared leading to a device which is apparently running but has a Wei> stopped queue. Wei> We actually have two places where SDEV_RUNNING is set: once in Wei> scsi_add_lun() which respects the blocked flag and once in Wei> scsi_sysfs_add_sdev() which doesn't. Since the second set is Wei> entirely spurious, simply remove it to fix the problem. Applied to 4.10/scsi-fixes. -- Martin K. Petersen Oracle Linux Engineering -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html