Message ID | CAHZQxyKMcCaquQ9n8pJ9tNb3HRZ2e14iXXojYS3C4=dB6NpUKQ@mail.gmail.com |
---|---|
State | New |
Headers | show |
Series | scsi_lib: allow the ALUA transitioning state time to complete | expand |
On Thu, Jun 02, 2022 at 08:10:28AM -0700, Brian Bunker wrote: > static void scsi_io_completion_reprep(struct scsi_cmnd *cmd, > - struct request_queue *q) > + struct request_queue *q, > unsigned long msecs) > { > /* A new command will be prepared and issued. */ > - scsi_mq_requeue_cmd(cmd); > + scsi_mq_requeue_cmd(cmd, msecs); q is unused. But I think it is better if we just kill this pointless wrapper anyway. > + case ACTION_DELAYED_REPREP: > + scsi_io_completion_reprep(cmd, q, ALUA_TRANSITION_REPREP_DELAY); This is using spaces where it should use tabs.
On Thu, Jun 02, 2022 at 12:00:30PM -0700, Brian Bunker wrote: > > > + case ACTION_DELAYED_REPREP: > > > + scsi_io_completion_reprep(cmd, q, ALUA_TRANSITION_REPREP_DELAY); > > > > This is using spaces where it should use tabs. > > > > Like this then: Looks your mailer actually converted all tabs to spaces..
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index e9db7da0c79c..2a75f740914c 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -118,7 +118,7 @@ scsi_set_blocked(struct scsi_cmnd *cmd, int reason) } } -static void scsi_mq_requeue_cmd(struct scsi_cmnd *cmd) +static void scsi_mq_requeue_cmd(struct scsi_cmnd *cmd, unsigned long msecs) { struct request *rq = scsi_cmd_to_rq(cmd); @@ -128,7 +128,12 @@ static void scsi_mq_requeue_cmd(struct scsi_cmnd *cmd) } else { WARN_ON_ONCE(true); } - blk_mq_requeue_request(rq, true); + + if (msecs) { + blk_mq_requeue_request(rq, false); + blk_mq_delay_kick_requeue_list(rq->q, msecs); + } else + blk_mq_requeue_request(rq, true); } /** @@ -660,10 +665,10 @@ static unsigned int scsi_rq_err_bytes(const struct request *rq) /* Helper for scsi_io_completion() when "reprep" action required. */ static void scsi_io_completion_reprep(struct scsi_cmnd *cmd, - struct request_queue *q) + struct request_queue *q, unsigned long msecs) { /* A new command will be prepared and issued. */ - scsi_mq_requeue_cmd(cmd); + scsi_mq_requeue_cmd(cmd, msecs); }