• Nicholas Bellinger's avatar
    iser-target: Fix session reset bug with RDMA_CM_EVENT_DISCONNECTED · b2cb9649
    Nicholas Bellinger authored
    This patch addresses a bug where RDMA_CM_EVENT_DISCONNECTED may occur
    before the connection shutdown has been completed by rx/tx threads,
    that causes isert_free_conn() to wait indefinately on ->conn_wait.
    
    This patch allows isert_disconnect_work code to invoke rdma_disconnect
    when isert_disconnect_work() process context is started by client
    session reset before isert_free_conn() code has been reached.
    
    It also adds isert_conn->conn_mutex protection for ->state within
    isert_disconnect_work(), isert_cq_comp_err() and isert_free_conn()
    code, along with isert_check_state() for wait_event usage.
    
    (v2: Add explicit iscsit_cause_connection_reinstatement call
         during isert_disconnect_work() to force conn reset)
    
    Cc: stable@vger.kernel.org  # 3.10+
    Cc: Or Gerlitz <ogerlitz@mellanox.com>
    Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
    b2cb9649
iscsi_transport.h 3.78 KB