diff --git a/lib/iscsi/conn.c b/lib/iscsi/conn.c index f88ce79e1..506f13806 100644 --- a/lib/iscsi/conn.c +++ b/lib/iscsi/conn.c @@ -313,7 +313,6 @@ spdk_iscsi_conn_free_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pd if (pdu->task) { spdk_iscsi_task_put(pdu->task); - spdk_iscsi_conn_handle_queued_datain_tasks(conn); } spdk_put_pdu(pdu); diff --git a/lib/iscsi/iscsi.c b/lib/iscsi/iscsi.c index d0a677b34..d76a76ce8 100644 --- a/lib/iscsi/iscsi.c +++ b/lib/iscsi/iscsi.c @@ -2881,6 +2881,14 @@ get_transfer_task(struct spdk_iscsi_conn *conn, uint32_t transfer_tag) return NULL; } +static void +spdk_iscsi_conn_datain_pdu_complete(void *arg) +{ + struct spdk_iscsi_conn *conn = arg; + + spdk_iscsi_conn_handle_queued_datain_tasks(conn); +} + static int iscsi_send_datain(struct spdk_iscsi_conn *conn, struct spdk_iscsi_task *task, int datain_flag, @@ -2983,7 +2991,7 @@ iscsi_send_datain(struct spdk_iscsi_conn *conn, } } - spdk_iscsi_conn_write_pdu(conn, rsp_pdu, spdk_iscsi_conn_pdu_generic_complete, NULL); + spdk_iscsi_conn_write_pdu(conn, rsp_pdu, spdk_iscsi_conn_datain_pdu_complete, conn); return DataSN; }