• Nicholas Bellinger's avatar
    iscsi/iser-target: Fix isert_conn->state hung shutdown issues · defd8848
    Nicholas Bellinger authored
    This patch addresses a couple of different hug shutdown issues
    related to wait_event() + isert_conn->state.  First, it changes
    isert_conn->conn_wait + isert_conn->conn_wait_comp_err from
    waitqueues to completions, and sets ISER_CONN_TERMINATING from
    within isert_disconnect_work().
    
    Second, it splits isert_free_conn() into isert_wait_conn() that
    is called earlier in iscsit_close_connection() to ensure that
    all outstanding commands have completed before continuing.
    
    Finally, it breaks isert_cq_comp_err() into seperate TX / RX
    related code, and adds logic in isert_cq_rx_comp_err() to wait
    for outstanding commands to complete before setting ISER_CONN_DOWN
    and calling complete(&isert_conn->conn_wait_comp_err).
    Acked-by: default avatarSagi Grimberg <sagig@mellanox.com>
    Cc: Or Gerlitz <ogerlitz@mellanox.com>
    Cc: <stable@vger.kernel.org> #3.10+
    Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
    defd8848
iscsi_target.c 126 KB