Mike Christie f24ee7391a scsi: core: Fix passthrough retry counter handling
commit fac8e558da9485e13a0ae0488aa0b8a8c307cd34 upstream.

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 and overwrite what the
passthrough user set.

This moves the allowed initialization to after the blk_rq_is_passthrough()
check so it's only done for the non-passthrough path where the ULD
init_command will normally set an allowed value it prefers.

Link: https://lore.kernel.org/r/20220812011206.9157-1-michael.christie@oracle.com
Fixes: 6aded12b10e0 ("scsi: core: Remove struct scsi_request")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-31 17:18:20 +02:00
..
2022-05-15 18:31:28 -06:00
2022-08-17 15:14:17 +02:00
2022-08-31 17:18:18 +02:00
2022-06-02 15:23:54 -07:00
2022-08-17 15:14:21 +02:00
2022-05-09 23:09:10 +02:00
2022-08-25 11:45:19 +02:00
2022-06-03 11:48:47 -07:00
2022-05-11 08:29:11 +03:00
2022-08-25 11:45:42 +02:00
2022-06-05 09:25:12 -07:00
2022-06-05 09:25:12 -07:00