public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michael.christie@oracle.com>
To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	james.bottomley@hansenpartnership.com
Cc: Mike Christie <michael.christie@oracle.com>
Subject: [PATCH 1/4] scsi: Fix passthrough retry counter handling
Date: Tue,  9 Aug 2022 22:41:52 -0500	[thread overview]
Message-ID: <20220810034155.20744-2-michael.christie@oracle.com> (raw)
In-Reply-To: <20220810034155.20744-1-michael.christie@oracle.com>

Passthrough users will set the scsi_cmnd->allowed value and were
expecting up to $allowed retries. The problem is that before:

commit 6aded12b10e0 ("scsi: core: Remove struct scsi_request")

we used to set the retries on the scsi_request then copy them over to
scsi_cmnd->allowed in scsi_setup_scsi_cmnd. With that patch we now set
scsi_cmnd->allowed to 0 in scsi_prepare_cmd then for passthrough
commands never set it again.

This patch adds a check for passthrough commands where if set then we
leave the allowed field alone since the submitter already set it.

Fixes: 6aded12b10e0 ("scsi: core: Remove struct scsi_request")
Signed-off-by: Mike Christie <michael.christie@oracle.com>
---
 drivers/scsi/scsi_lib.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 4dbd29ab1dcc..3ef85c8b689d 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1541,8 +1541,10 @@ static blk_status_t scsi_prepare_cmd(struct request *req)
 
 	scsi_init_command(sdev, cmd);
 
+	if (!blk_rq_is_passthrough(req))
+		cmd->allowed = 0;
+
 	cmd->eh_eflags = 0;
-	cmd->allowed = 0;
 	cmd->prot_type = 0;
 	cmd->prot_flags = 0;
 	cmd->submitter = 0;
-- 
2.18.2


  reply	other threads:[~2022-08-10  3: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 ` Mike Christie [this message]
2022-08-11 12:16   ` [PATCH 1/4] scsi: Fix passthrough retry counter handling 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
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=20220810034155.20744-2-michael.christie@oracle.com \
    --to=michael.christie@oracle.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=mwilck@suse.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