In case (a) scsi_eh_inc_host_failed() will wake up the error handler. And in case (b) scsi_dec_host_busy() will wake up the error handler. So it's not clear to me why you think that there is a scenario in which the EH won't be woken up?
So in case (b), in my understanding, scsi_dec_host_busy can skip wakeups as it does not see host_failed change yet.
That's not correct. If scsi_dec_host_busy() obtains the SCSI host lock before scsi_eh_inc_host_failed() obtains it then the latter function will trigger a SCSI EH wakeup.
You are right! Thanks a lot for pointing that out! Now when I understand it, your patch looks good for me:
Reviewed-by: Pavel Tikhomirov ptikhomirov@virtuozzo.com
By the way, I very much like your idea of using rcu for these case.
Thanks, Pavel.
This patch tests ok on my system, too... it's run for over 24 hours, on a system that typically fails within ten minutes without the patch...
Tested-by: Stuart Hayes stuart.w.hayes@gmail.com
Thanks, Stuart
--- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus