aboutsummaryrefslogtreecommitdiff
path: root/drivers/ata/pata_artop.c
diff options
context:
space:
mode:
authorWenchao Hao <haowenchao@huawei.com>2022-11-23 20:21:36 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2022-11-24 03:41:31 +0000
commitec9780e48c77f469c339b53940ef0c5eacc8b9d2 (patch)
tree65bba2d4270253479a04a065ad52e4a84e9c3139 /drivers/ata/pata_artop.c
parent0c26a2d7c98039e913e63f9250fde738a3f88a60 (diff)
scsi: core: Increase scsi_device's iodone_cnt in scsi_timeout()
If a SCSI command times out and is going to be aborted, we should increase the iodone_cnt of the related scsi_device. Otherwise the iodone_cnt would be smaller than iorequest_cnt. Increasing iodone_cnt in scsi_timeout() would not cause a double accounting issue. Brief analysis follows: - We add the iodone_cnt when BLK_EH_DONE is returned in scsi_timeout(). The related command's timeout event would not happen. - If the abort succeeds and the command is not retried, the command would be completed with scsi_finish_command() which would not increase iodone_cnt. - If the abort succeeds and the command is retried, it would be requeue. A scsi_dispatch_cmd() would be called and iorequest_cnt would be increased again. - If the abort fails, the error handler successfully recovers the device, and the command is not retried, the command would be completed with scsi_finish_command() which would not increase iodone_cnt. - If the abort fails, the error handler successfully recovers the device, and the command is retried, the iorequest_cnt would be increased again. Signed-off-by: Wenchao Hao <haowenchao@huawei.com> Link: https://lore.kernel.org/r/20221123122137.150776-2-haowenchao@huawei.com Reviewed-by: Mike Christie <michael.christie@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/ata/pata_artop.c')
0 files changed, 0 insertions, 0 deletions