On 9/22/23 02:36, Wenchao Hao wrote:
SDEV_CANCEL is set when removing device and scsi_device_online() should
return false if sdev_state is SDEV_CANCEL.

IO hang would be caused if return true when state is SDEV_CANCEL with
following order:

T1:                                         T2:scsi_error_handler
__scsi_remove_device()
   scsi_device_set_state(sdev, SDEV_CANCEL)
                                            scsi_eh_flush_done_q()
                                            if (scsi_device_online(sdev))
                                              scsi_queue_insert(scmd,...)

The command added by scsi_queue_insert() would never be handled any
more.

Why not? I think the blk_mq_destroy_queue() call in __scsi_remove_device() will cause it to fail.

Thanks,

Bart.

--
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/open-iscsi/50b20a3e-e264-4788-8e52-f7b57cf944f0%40acm.org.

Reply via email to