• Shyam Prasad N's avatar
    cifs: avoid race during socket reconnect between send and recv · bda487ac
    Shyam Prasad N authored
    When a TCP connection gets reestablished by the sender in cifs_reconnect,
    There is a chance for race condition with demultiplex thread waiting in
    cifs_readv_from_socket on the old socket. It will now return -ECONNRESET.
    
    This condition is handled by comparing socket pointer before and after
    sock_recvmsg. If the socket pointer has changed, we should not call
    cifs_reconnect again, but instead retry with new socket.
    
    Also fixed another bug in my prev mchan commits.
    We should always reestablish session (even if binding) on a channel
    that needs reconnection.
    Signed-off-by: default avatarShyam Prasad N <sprasad@microsoft.com>
    Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
    bda487ac
smb2pdu.c 155 KB