nvme: don't call request callback if it is inactive
Change-Id: I150ed2dc7cea91f262ee0773c892069a56b68902 Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
This commit is contained in:
parent
9459848ce5
commit
0bd08c4536
@ -365,7 +365,7 @@ nvme_qpair_complete_tracker(struct spdk_nvme_qpair *qpair, struct nvme_tracker *
|
|||||||
struct spdk_nvme_cpl *cpl, bool print_on_error)
|
struct spdk_nvme_cpl *cpl, bool print_on_error)
|
||||||
{
|
{
|
||||||
struct nvme_request *req;
|
struct nvme_request *req;
|
||||||
bool retry, error;
|
bool retry, error, was_active;
|
||||||
|
|
||||||
req = tr->req;
|
req = tr->req;
|
||||||
|
|
||||||
@ -380,6 +380,7 @@ nvme_qpair_complete_tracker(struct spdk_nvme_qpair *qpair, struct nvme_tracker *
|
|||||||
nvme_qpair_print_completion(qpair, cpl);
|
nvme_qpair_print_completion(qpair, cpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
was_active = qpair->tr[cpl->cid].active;
|
||||||
qpair->tr[cpl->cid].active = false;
|
qpair->tr[cpl->cid].active = false;
|
||||||
|
|
||||||
assert(cpl->cid == req->cmd.cid);
|
assert(cpl->cid == req->cmd.cid);
|
||||||
@ -388,7 +389,7 @@ nvme_qpair_complete_tracker(struct spdk_nvme_qpair *qpair, struct nvme_tracker *
|
|||||||
req->retries++;
|
req->retries++;
|
||||||
nvme_qpair_submit_tracker(qpair, tr);
|
nvme_qpair_submit_tracker(qpair, tr);
|
||||||
} else {
|
} else {
|
||||||
if (req->cb_fn) {
|
if (was_active && req->cb_fn) {
|
||||||
req->cb_fn(req->cb_arg, cpl);
|
req->cb_fn(req->cb_arg, cpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user