Skip to content

Commit

Permalink
lib/nvme: don't submit request if qpair is disconnected.
Browse files Browse the repository at this point in the history
This becomes a problem when the qpair is reconnected.

Signed-off-by: Seth Howell <[email protected]>
Change-Id: I6677b396cf766684a4891ffbee93aa3e4e83374d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3391
Tested-by: SPDK CI Jenkins <[email protected]>
Reviewed-by: Ben Walker <[email protected]>
Reviewed-by: Jim Harris <[email protected]>
  • Loading branch information
Seth5141 authored and tomzawadzki committed Jul 31, 2020
1 parent 612aa86 commit 0d8f86f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/nvme/nvme_qpair.c
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,10 @@ _nvme_qpair_submit_request(struct spdk_nvme_qpair *qpair, struct nvme_request *r

nvme_qpair_check_enabled(qpair);

if (nvme_qpair_get_state(qpair) == NVME_QPAIR_DISCONNECTED) {
return -ENXIO;
}

if (req->num_children) {
/*
* This is a split (parent) request. Submit all of the children but not the parent
Expand Down
1 change: 1 addition & 0 deletions test/unit/lib/nvme/nvme_qpair.c/nvme_qpair_ut.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ test3(void)
struct nvme_request *req;
struct spdk_nvme_ctrlr ctrlr = {};

qpair.state = NVME_QPAIR_ENABLED;
prepare_submit_request_test(&qpair, &ctrlr);

req = nvme_allocate_request_null(&qpair, expected_success_callback, NULL);
Expand Down

0 comments on commit 0d8f86f

Please sign in to comment.