linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH] scsi: core: use eh_timeout to timeout start_unit command
@ 2021-11-08  2:19 brookxu
  2021-11-09 10:03 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: brookxu @ 2021-11-08  2:19 UTC (permalink / raw)
  To: jejb, martin.petersen; +Cc: linux-scsi, linux-kernel

From: Chunguang Xu <brookxu@tencent.com>

In some abnormal scenarios, STU may timeout. The recovery time
of 30 seconds is relatively long. Now we need to adjusting
rq_timeout to adjust STU timeout value, but it will affect the
actual IO.

ptach 9728c081(make scsi_eh_try_stu use block timeout) uses
rq_timeout to timeout the STU command, but after pathc 0816c92(
Allow error handling timeout to be specified) eh_timeout will
init to SCSI_DEFAULT_EH_TIMEOUT, so it is more reasonable to
use eh_timeout as the timeout value of STU command. In this way,
we can uniformly control the recovery time through eh_timeout.

Signed-off-by: Chunguang Xu <brookxu@tencent.com>
---
 drivers/scsi/scsi_error.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index b6c86cc..ec864d1 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -1404,7 +1404,7 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd)
 		enum scsi_disposition rtn = NEEDS_RETRY;
 
 		for (i = 0; rtn == NEEDS_RETRY && i < 2; i++)
-			rtn = scsi_send_eh_cmnd(scmd, stu_command, 6, scmd->device->request_queue->rq_timeout, 0);
+			rtn = scsi_send_eh_cmnd(scmd, stu_command, 6, scmd->device->eh_timeout, 0);
 
 		if (rtn == SUCCESS)
 			return 0;
-- 
1.8.3.1


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

* Re: [RESEND PATCH] scsi: core: use eh_timeout to timeout start_unit command
  2021-11-08  2:19 [RESEND PATCH] scsi: core: use eh_timeout to timeout start_unit command brookxu
@ 2021-11-09 10:03 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2021-11-09 10:03 UTC (permalink / raw)
  To: brookxu; +Cc: jejb, martin.petersen, linux-scsi, linux-kernel

On Mon, Nov 08, 2021 at 10:19:16AM +0800, brookxu wrote:
> From: Chunguang Xu <brookxu@tencent.com>
> 
> In some abnormal scenarios, STU may timeout. The recovery time
> of 30 seconds is relatively long. Now we need to adjusting
> rq_timeout to adjust STU timeout value, but it will affect the
> actual IO.
> 
> ptach 9728c081(make scsi_eh_try_stu use block timeout) uses
> rq_timeout to timeout the STU command, but after pathc 0816c92(

patch is mispelled in two different ways here.  But you probably
want to use commit anyway and use 12 charater commit hashes.

> -			rtn = scsi_send_eh_cmnd(scmd, stu_command, 6, scmd->device->request_queue->rq_timeout, 0);
> +			rtn = scsi_send_eh_cmnd(scmd, stu_command, 6, scmd->device->eh_timeout, 0);

Both the old and new coe is completely unreadable.  Please wrap lines
after 80 characters

Otherwise this looks good.

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

end of thread, other threads:[~2021-11-09 10:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08  2:19 [RESEND PATCH] scsi: core: use eh_timeout to timeout start_unit command brookxu
2021-11-09 10:03 ` Christoph Hellwig

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).