From: Martin Wilck <mwilck@suse.com>
To: Mike Christie <michael.christie@oracle.com>,
bvanassche@acm.org, hch@lst.de, martin.petersen@oracle.com,
linux-scsi@vger.kernel.org,
james.bottomley@hansenpartnership.com
Cc: Hannes Reinecke <Hannes.Reinecke@suse.com>
Subject: Re: [PATCH 3/4] scsi: Internally retry scsi_execute commands
Date: Wed, 10 Aug 2022 12:46:17 +0200 [thread overview]
Message-ID: <6149f7bdfa013e0352e59dee2669298b2c080a03.camel@suse.com> (raw)
In-Reply-To: <20220810034155.20744-4-michael.christie@oracle.com>
Hi Mike,
On Tue, 2022-08-09 at 22:41 -0500, Mike Christie wrote:
> In several places like LU setup and pr_ops we will hit the noretry
> code
> path because we do not retry any passthrough commands that hit device
> errors even though scsi-ml thinks the command is retryable.
>
> This has us only fast fail commands that hit device errors that have
> been
> submitted through the block layer directly and not via scsi_execute.
> This
> allows SG IO and other users to continue to get fast failures and all
> device errors returned to them, and scsi_execute users will get their
> retries they had requested.
>
> Signed-off-by: Mike Christie <michael.christie@oracle.com>
Thanks a lot. I like the general approach, but I am concerned that by
treating every command sent by scsi_execute() or scsi_execute_req() as
a retryable command, we may break some callers, or at least modify
their semantics in unexpected ways. For example, spi_execute(),
scsi_probe_lun(), scsi_report_lun_scan() currently retry only on UA.
With this change, these commands will be retried in additional cases,
without the caller noticing (see 949bf797595fc ("[SCSI] fix command
retries in spi_transport class"). It isn't obvious to me that this is
correct in all affected cases.
Note that the retry logic of the mid level may change depending on the
installed device handler. For example, ALUA devices will endlessly
retry UA with ASC=29, which some callers explicitly look for.
I believe we need to review all callers that have their own retry loop
and /or error handling logic. This includes sd_spinup_disk(),
sd_sync_cache(), scsi_test_unit_ready(). SCSI device handlers treat
some sense keys in special ways, or may retry commands on another
member of a port group (see alua_rtpg()).
DID_TIME_OUT is a general concern - no current caller of scsi_execute()
expects timed-out commands to be retried, and doing so has the
potential of slowing down operations a lot. I am aware that my recent
patch changed exactly this for scsi_probe_lun(), but doing the same
thing for every scsi_execute() invocation sounds at least somewhat
dangerous.
Bottom line: I wonder if SUBMITTED_BY_SCSI_EXEC is suffient to
determine that a command should be retried like an ordinary block level
command.
Regards,
Martin
> ---
> drivers/scsi/scsi_error.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
> index ac4471e33a9c..573d926220c4 100644
> --- a/drivers/scsi/scsi_error.c
> +++ b/drivers/scsi/scsi_error.c
> @@ -1806,7 +1806,8 @@ bool scsi_noretry_cmd(struct scsi_cmnd *scmd)
> * assume caller has checked sense and determined
> * the check condition was retryable.
> */
> - if (req->cmd_flags & REQ_FAILFAST_DEV ||
> blk_rq_is_passthrough(req))
> + if (req->cmd_flags & REQ_FAILFAST_DEV ||
> + scmd->submitter == SUBMITTED_BY_BLOCK_PT)
> return true;
>
> return false;
next prev parent reply other threads:[~2022-08-10 10:46 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-10 3:41 [PATCH 0/4] scsi: passthrough fixes/improvements Mike Christie
2022-08-10 3:41 ` [PATCH 1/4] scsi: Fix passthrough retry counter handling Mike Christie
2022-08-11 12:16 ` Christoph Hellwig
2022-08-10 3:41 ` [PATCH 2/4] scsi: Add new SUBMITTED types for passthrough Mike Christie
2022-08-11 12:21 ` Christoph Hellwig
2022-08-10 3:41 ` [PATCH 3/4] scsi: Internally retry scsi_execute commands Mike Christie
2022-08-10 10:46 ` Martin Wilck [this message]
2022-08-10 17:06 ` Mike Christie
2022-08-10 17:38 ` Mike Christie
2022-08-11 12:28 ` Christoph Hellwig
2022-08-11 16:19 ` Mike Christie
2022-08-11 9:56 ` Martin Wilck
2022-08-11 16:15 ` Mike Christie
2022-08-11 17:02 ` Martin Wilck
2022-08-11 18:22 ` Mike Christie
2022-08-11 12:27 ` Christoph Hellwig
2022-08-10 3:41 ` [PATCH 4/4] scsi: Handle UAs for pr_ops Mike Christie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6149f7bdfa013e0352e59dee2669298b2c080a03.camel@suse.com \
--to=mwilck@suse.com \
--cc=Hannes.Reinecke@suse.com \
--cc=bvanassche@acm.org \
--cc=hch@lst.de \
--cc=james.bottomley@hansenpartnership.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=michael.christie@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox