Re: BUG: CD driver sends command during host removal

Mike Anderson
2004-10-11T20:40:55Z

James Bottomley [James.Bottomley@SteelEye.com] wrote:
> On Mon, 2004-10-11 at 15:03, Alan Stern wrote:
> > The problem arises when a command completes. In the notified ejection
> > case, if the LLD tries to call the scsi_done routine for a completed
> > command which was submitted before scsi_remove_host and which the SCSI
> > core has already cleaned up, it will cause an oops. Since the LLD has no
> > way to tell whether the core has cleaned up a command or not, its only
> > choice is to fail _every_ command starting shortly before it calls
> > scsi_remove_host.
>
> This is the remove implies cancel issue that was discussed earlier. I
> thought the proposal was to have a remove that wouldn't automatically
> cancel all the commands? ... although I don't think I've seen any code
> for that case yet.
>

Clarification. James, are you indicating that there needs to be a new
scsi mid api that performs similar function to scsi_remove_host expect
does not cancel commands?

If is unclear to me if a LLDD provides a slave_destroy which is called
from scsi_remove_device during the scsi_forget_host function that we
would hit a case where the LLDD has good IO to complete still
outstanding when we complete scsi_forget_host and call scsi_host_cancel.

Is there some locking / synchronization issue with our state changes and
the scsi_prep_fn / scsi_request_fn / scsi_dispatch_cmd sequence?

-andmike
--
Michael Anderson
andmike@us.ibm.com