Thread (18 messages) 18 messages, 6 authors, 2018-07-23

Re: [PATCH 2/2] scsi: set timed out out mq requests to complete

From: Bart Van Assche <hidden>
Date: 2018-07-20 15:12:59
Also in: linux-nvme

On Thu, 2018-07-19 at 15:26 -0600, Keith Busch wrote:
quoted hunk ↗ jump to hunk
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_er=
ror.c
quoted hunk ↗ jump to hunk
index 8932ae81a15a..86ee10b2c775 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -286,6 +286,9 @@ enum blk_eh_timer_return=
 scsi_times_out(struct request *req)
 	enum blk_eh_timer_return rtn = BLK_EH_DONE�
ADs-
 	struct Scsi_Host *host = scmd->device->host;=
-
=20
+	if (req->q->mq_ops && blk_mq_mark_co=
mplete(req))
quoted hunk ↗ jump to hunk
+		return rtn;
+
 	trace_scsi_dispatch_cmd_timeout(scmd);
 	scsi_log_completion(scmd, TIMEOUT_ERROR);
=20
@@ -300,7 +303,8 @@ enum blk_eh_timer_return=
 scsi_times_out(struct request *req)
 			set_host_byte(scmd, DID_TIME_OUT);
 			scsi_eh_scmd_add(scmd);
 		}
-	}
+	} else if (req->q->mq_ops)
+		WRITE_ONCE(req->state, MQ_RQ_IN_FLIGHT);
=20
 	return rtn;
 }
Modifying the completion state and req->state from the SCSI core are la=
yering
violations. Have you considered to move the above changes into blk_mq�
F8-rq_timed_out()?
An additional benefit of that approach is that the req->q->mq_o=
ps checks can be
left out.

Thanks,

Bart.=
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help