Commit a0e16aec authored by LiadOz's avatar LiadOz Committed by Jim Harris
Browse files

nvme/tcp: check for failed controller when checking command timeout



nvme_tcp_qpair_check_timeout can be called when the controller is in a
failed state which causes a segmentation fault.
Fixes #3040

Change-Id: I4a31ff81381d8abb911fcec4272c5f4444522fc6
Signed-off-by: default avatarLiad Oz <liadozil@gmail.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19743


Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@gmail.com>
parent 38ac7146
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2098,6 +2098,10 @@ nvme_tcp_qpair_check_timeout(struct spdk_nvme_qpair *qpair)

	t02 = spdk_get_ticks();
	TAILQ_FOREACH_SAFE(tcp_req, &tqpair->outstanding_reqs, link, tmp) {
		if (ctrlr->is_failed) {
			/* The controller state may be changed to failed in one of the nvme_request_check_timeout callbacks. */
			return;
		}
		assert(tcp_req->req != NULL);

		if (nvme_request_check_timeout(tcp_req->req, tcp_req->cid, active_proc, t02)) {