linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: increase scsi device's iodone_cnt in scsi_timeout()
@ 2022-08-15 16:43 Wenchao Hao
  2022-08-15 16:53 ` Steffen Maier
  2022-08-23 12:27 ` Wu Bo
  0 siblings, 2 replies; 4+ messages in thread
From: Wenchao Hao @ 2022-08-15 16:43 UTC (permalink / raw)
  To: James E . J . Bottomley, Martin K . Petersen, linux-scsi, linux-kernel
  Cc: Wenchao Hao

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);
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-23 15:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-15 16:43 [PATCH] scsi: increase scsi device's iodone_cnt in scsi_timeout() Wenchao Hao
2022-08-15 16:53 ` Steffen Maier
2022-08-16  4:36   ` wenchao hao
2022-08-23 12:27 ` Wu Bo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).