Re: BUG: CD driver sends command during host removal

James Bottomley
2004-09-29T19:51:04Z

On Wed, 2004-09-29 at 15:01, Alan Stern wrote:
> Regardless of how descriptive the value is, the code in
> scsi_dispatch_cmd treats anything other than SCSI_MLQUEUE_DEVICE_BUSY
> as SCSI_MLQUEUE_HOST_BUSY. Will this matter?

Yes, you have to call cmd->done() having set the result field to
DID_NO_CONNECT; then return zero from queuecommand() indicating that
you're dealling with the command.

> It sounds like the two of you are in contradiction. Should the SCSI core
> deallocate in-flight commands without consulting the LLDD or shouldn't it?

Once you've called scsi_remove_host() the mid-layer will take control of
your in-flight commands (if there are any) and error them back to the
user. You need to take any actions to clean up internal structures
belonging to the commands *before* you do a scsi_remove_host.

James