• Sagi Grimberg's avatar
    iscsi,iser-target: Initiate termination only once · 954f2372
    Sagi Grimberg authored
    Since commit 0fc4ea70 ("Target/iser: Don't put isert_conn inside
    disconnected handler") we put the conn kref in isert_wait_conn, so we
    need .wait_conn to be invoked also in the error path.
    
    Introduce call to isert_conn_terminate (called under lock)
    which transitions the connection state to TERMINATING and calls
    rdma_disconnect. If the state is already teminating, just bail
    out back (temination started).
    
    Also, make sure to destroy the connection when getting a connect
    error event if didn't get to connected (state UP). Same for the
    handling of REJECTED and UNREACHABLE cma events.
    
    Squashed:
    
    iscsi-target: Add call to wait_conn in establishment error flow
    Reported-by: default avatarSlava Shwartsman <valyushash@gmail.com>
    Signed-off-by: default avatarSagi Grimberg <sagig@mellanox.com>
    Cc: <stable@vger.kernel.org> # v3.10+
    Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
    954f2372
ib_isert.h 4.29 KB