From: jiang.biao2@zte.com.cn Date: Fri, 31 Jul 2015 09:52:10 +0000 (+0800) Subject: scsi_error: should not get sense for timeout IO in scsi error handler X-Git-Tag: omap-for-v4.3/fixes-rc1~115^2~28 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=709c75b5a2411c31e5a649a2cd6d4866dd11f456;p=pandora-kernel.git scsi_error: should not get sense for timeout IO in scsi error handler scsi_error: should not get sense for timeout IO in scsi error handler When an IO timeout occurs, the IO will be aborted in scsi_abort_command() and SCSI_EH_ABORT_SCHEDULED will be set. Because of that, the SCSI_EH_CANCEL_CMD will be clear in scsi_eh_scmd_add(). So when scsi error handler starts, it will get sense for this timeout IO and the scmd of the IO request will be reused. In that case, the scmd may be double released when racing with io_done(), which will result in crash. SO SCSI_EH_ABORT_SCHEDULED should also be checked when getting sense. The bug maybe reproduced when the link between host and disk is unstable. Signed-off-by: Jiang Biao Signed-off-by: Long Chun Reviewed-by: Tan Hu Reviewed-by: Chen Donghai Reviewed-by: Cai Qu Signed-off-by: James Bottomley --- Reading git-diff-tree failed