• Hyunchul Lee's avatar
    ksmbd: smbd: call rdma_accept() under CM handler · 99b7650a
    Hyunchul Lee authored
    if CONFIG_LOCKDEP is enabled, the following
    kernel warning message is generated because
    rdma_accept() checks whehter the handler_mutex
    is held by lockdep_assert_held. CM(Connection
    Manager) holds the mutex before CM handler
    callback is called.
    
    [   63.211405 ] WARNING: CPU: 1 PID: 345 at drivers/infiniband/core/cma.c:4405 rdma_accept+0x17a/0x350
    [   63.212080 ] RIP: 0010:rdma_accept+0x17a/0x350
    ...
    [   63.214036 ] Call Trace:
    [   63.214098 ]  <TASK>
    [   63.214185 ]  smb_direct_accept_client+0xb4/0x170 [ksmbd]
    [   63.214412 ]  smb_direct_prepare+0x322/0x8c0 [ksmbd]
    [   63.214555 ]  ? rcu_read_lock_sched_held+0x3a/0x70
    [   63.214700 ]  ksmbd_conn_handler_loop+0x63/0x270 [ksmbd]
    [   63.214826 ]  ? ksmbd_conn_alive+0x80/0x80 [ksmbd]
    [   63.214952 ]  kthread+0x171/0x1a0
    [   63.215039 ]  ? set_kthread_struct+0x40/0x40
    [   63.215128 ]  ret_from_fork+0x22/0x30
    
    To avoid this, move creating a queue pair and accepting
    a client from transport_ops->prepare() to
    smb_direct_handle_connect_request().
    Acked-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
    Signed-off-by: default avatarHyunchul Lee <hyc.lee@gmail.com>
    Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
    99b7650a
transport_rdma.c 57.2 KB