James Smart wrote: >> Do we >> need the scan mutex to change the device state? I mean if a scan has >> the mutex lock, and the transport class decides to remove the device >> it tries to grab the scan_mutex by calling scsi_remove_device, but if >> we moved the state change invocation before the scan_mutex is taken in >> scsi_remove_device then, I assume eventually the device should get >> unplugged, the prep or request_fn will see the new state and fail the >> request. > > This may be what's needed. I don't understand all of this path yet, so I > can only speculate (and likely w/ error). Thus, the questions. Actually, maybe, I should not have brought this up as it could just be more of a workaround of the core problem. For FC in fc_user_scan() do you need some sort of lock around the rport loop? - : 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