On 03/06/2017 06:16 AM, Sreekanth Reddy wrote:
> I feel that using these flags are not working as expected. From the
> driver's prospective it should return status of the TM based on
> whether it has cleared reference of the timed out IO in the driver or
> not (i.e. if it is successfully able to clear the reference (i.e.
> cleared from scsi lookup) of the timed out IO from driver, firmware
> then return success status otherwise return failure status). It should
> not check for it's above layer reference.
> 
Looking into it you are actually right.

The SCSI midlayer will only decrease a 'device_busy' and the like if the
commands are completed, ie after ->scsi_done() has been called.
But the whole point of the error handler OTOH is that ->scsi_done() is
_not_ called, but rather the commands are left alone until SCSI EH
completed, and only _then_ calling ->scsi_done().

Hence 'device_busy' et al trivially can never be zero while SCSI EH is
running.

I'll be rewriting that for the next submission.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Teamlead Storage & Networking
h...@suse.de                                   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

Reply via email to