nvmf: clean up nvmf_recv() error path

If spdk_nvmf_request_exec() fails, the connection will be closed anyway,
so just leave the tx_desc in the active array; it will be cleaned up in
the normal connection cleanup path.

Change-Id: Ie4f60bd6001658403dd7e1c6a47d40be756ef6f2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-06-27 14:14:02 -07:00
parent 3d9ef1a94e
commit d63007e5ca

View File

@ -1176,21 +1176,17 @@ nvmf_recv(struct spdk_nvmf_conn *conn, struct ibv_wc *wc)
ret = spdk_nvmf_request_exec(req);
if (ret < 0) {
SPDK_ERRLOG("Command execution failed\n");
return -1;
}
} else if (ret > 0) {
/*
* Pending transfer from host to controller; command will continue
* once transfer is complete.
*/
ret = 0;
return 0;
}
if (ret < 0) {
/* recover the tx_desc */
nvmf_deactive_tx_desc(tx_desc);
}
return ret;
/*
* Pending transfer from host to controller; command will continue
* once transfer is complete.
*/
return 0;
}
int