diff --git a/lib/iscsi/iscsi.c b/lib/iscsi/iscsi.c index ef41c1f024..41bc6215a2 100644 --- a/lib/iscsi/iscsi.c +++ b/lib/iscsi/iscsi.c @@ -2797,7 +2797,8 @@ start_queued_transfer_tasks(struct spdk_iscsi_conn *conn) } } -void spdk_del_transfer_task(struct spdk_iscsi_conn *conn, uint32_t task_tag) +bool +spdk_del_transfer_task(struct spdk_iscsi_conn *conn, uint32_t task_tag) { struct spdk_iscsi_task *task; int i; @@ -2812,11 +2813,11 @@ void spdk_del_transfer_task(struct spdk_iscsi_conn *conn, uint32_t task_tag) conn->outstanding_r2t_tasks[i] = conn->outstanding_r2t_tasks[i + 1]; } conn->outstanding_r2t_tasks[conn->pending_r2t] = NULL; - break; + start_queued_transfer_tasks(conn); + return true; } } - - start_queued_transfer_tasks(conn); + return false; } static void diff --git a/lib/iscsi/iscsi.h b/lib/iscsi/iscsi.h index 73fee1c98e..146f8251e0 100644 --- a/lib/iscsi/iscsi.h +++ b/lib/iscsi/iscsi.h @@ -426,7 +426,7 @@ void spdk_free_sess(struct spdk_iscsi_sess *sess); void spdk_clear_all_transfer_task(struct spdk_iscsi_conn *conn, struct spdk_scsi_lun *lun, struct spdk_iscsi_pdu *pdu); -void spdk_del_transfer_task(struct spdk_iscsi_conn *conn, uint32_t CmdSN); +bool spdk_del_transfer_task(struct spdk_iscsi_conn *conn, uint32_t CmdSN); bool spdk_iscsi_is_deferred_free_pdu(struct spdk_iscsi_pdu *pdu); void spdk_iscsi_task_cpl(struct spdk_scsi_task *scsi_task); diff --git a/test/unit/lib/iscsi/conn.c/conn_ut.c b/test/unit/lib/iscsi/conn.c/conn_ut.c index e64d665427..01290dd325 100644 --- a/test/unit/lib/iscsi/conn.c/conn_ut.c +++ b/test/unit/lib/iscsi/conn.c/conn_ut.c @@ -156,8 +156,8 @@ DEFINE_STUB_V(spdk_iscsi_task_mgmt_response, DEFINE_STUB_V(spdk_iscsi_send_nopin, (struct spdk_iscsi_conn *conn)); -DEFINE_STUB_V(spdk_del_transfer_task, - (struct spdk_iscsi_conn *conn, uint32_t task_tag)); +DEFINE_STUB(spdk_del_transfer_task, bool, + (struct spdk_iscsi_conn *conn, uint32_t task_tag), true); int spdk_iscsi_conn_handle_queued_datain_tasks(struct spdk_iscsi_conn *conn)