lkml.org 
[lkml]   [2022]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] scsi: increase scsi device's iodone_cnt in scsi_timeout()
From
On 8/15/22 18:43, Wenchao Hao wrote:
> The iodone_cnt might be less than iorequest_cnt because
> we did not increase the iodone_cnt when a command is done
> from timeout.
>
> Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
> ---
> drivers/scsi/scsi_error.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
> index 448748e3fba5..d21ae0090166 100644
> --- a/drivers/scsi/scsi_error.c
> +++ b/drivers/scsi/scsi_error.c
> @@ -355,6 +355,7 @@ enum blk_eh_timer_return scsi_timeout(struct request *req)
> */
> if (test_and_set_bit(SCMD_STATE_COMPLETE, &scmd->state))
> return BLK_EH_RESET_TIMER;
> + atomic_inc(&scmd->device->iodone_cnt);
> if (scsi_abort_command(scmd) != SUCCESS) {
> set_host_byte(scmd, DID_TIME_OUT);
> scsi_eh_scmd_add(scmd);

Not sure, but can't we still get a (late) regular completion even after the
timeout happened (double accounting) and before we successfully aborted the
command?


--
Mit freundlichen Gruessen / Kind regards
Steffen Maier

Linux on IBM Z and LinuxONE

https://www.ibm.com/privacy/us/en/
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Gregor Pillen
Geschaeftsfuehrung: David Faller
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

\
 
 \ /
  Last update: 2022-08-15 18:55    [W:0.123 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site